mirror of https://github.com/M66B/FairEmail.git
Widget: fixed showing unified account messages (QA)
This commit is contained in:
parent
aed65976ca
commit
2ba5a88cea
|
@ -384,6 +384,7 @@ public interface DaoMessage {
|
|||
" JOIN account_view AS account ON account.id = message.account" +
|
||||
" JOIN folder_view AS folder ON folder.id = message.folder" +
|
||||
" WHERE account.`synchronize`" +
|
||||
" AND (:account IS NULL OR account.id = :account)" +
|
||||
" AND ((:folder IS NULL AND folder.unified) OR folder.id = :folder)" +
|
||||
" AND NOT message.ui_hide" +
|
||||
" AND message.ui_snoozed IS NULL" +
|
||||
|
@ -393,7 +394,7 @@ public interface DaoMessage {
|
|||
", CASE WHEN message.thread IS NULL OR NOT :threading THEN message.id ELSE message.thread END" +
|
||||
" ORDER BY message.received DESC")
|
||||
@SuppressWarnings(RoomWarnings.CURSOR_MISMATCH)
|
||||
List<TupleMessageWidget> getWidgetUnified(Long folder, boolean threading, boolean unseen, boolean flagged);
|
||||
List<TupleMessageWidget> getWidgetUnified(Long account, Long folder, boolean threading, boolean unseen, boolean flagged);
|
||||
|
||||
@Query("SELECT uid FROM message" +
|
||||
" WHERE folder = :folder" +
|
||||
|
|
|
@ -84,13 +84,10 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
|
|||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
if (folder < 0 && account > 0) {
|
||||
EntityFolder inbox = db.folder().getFolderByType(account, EntityFolder.INBOX);
|
||||
if (inbox != null)
|
||||
folder = inbox.id;
|
||||
}
|
||||
|
||||
messages = db.message().getWidgetUnified(folder < 0 ? null : folder, threading, unseen, flagged);
|
||||
messages = db.message().getWidgetUnified(
|
||||
account < 0 ? null : account,
|
||||
folder < 0 ? null : folder,
|
||||
threading, unseen, flagged);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue