diff --git a/app/src/main/java/eu/faircode/email/DaoFolder.java b/app/src/main/java/eu/faircode/email/DaoFolder.java index ad073f83ad..904a6f65d2 100644 --- a/app/src/main/java/eu/faircode/email/DaoFolder.java +++ b/app/src/main/java/eu/faircode/email/DaoFolder.java @@ -199,11 +199,12 @@ public interface DaoFolder { LiveData> liveUnified(); @Query("SELECT * FROM folder" + - " WHERE selected_count > 0" + + " WHERE account = :account" + + " AND selected_count > 0" + " AND NOT folder.id IN (:disabled)" + " ORDER BY selected_count DESC, selected_last DESC" + " LIMIT :count") - List getFavoriteFolders(int count, long[] disabled); + List getFavoriteFolders(long account, int count, long[] disabled); @Query("UPDATE folder" + " SET selected_last = :last, selected_count = selected_count + 1" + diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogFolder.java b/app/src/main/java/eu/faircode/email/FragmentDialogFolder.java index 25921d52b8..c32892ee44 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogFolder.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogFolder.java @@ -283,7 +283,7 @@ public class FragmentDialogFolder extends FragmentDialogBase { Data data = new Data(); data.folders = db.folder().getFoldersEx(account); - data.favorites = db.folder().getFavoriteFolders(3, disabled); + data.favorites = db.folder().getFavoriteFolders(account, 3, disabled); return data; }