diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 58e5d7ffb2..b61b5b780d 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -236,7 +236,8 @@ public interface DaoMessage { " WHEN folder.type = '" + EntityFolder.JUNK + "' THEN 6" + " WHEN folder.type = '" + EntityFolder.SYSTEM + "' THEN 7" + " WHEN folder.type = '" + EntityFolder.USER + "' THEN 8" + - " WHEN folder.type = '" + EntityFolder.ARCHIVE + "' THEN 9" + + " WHEN folder.type = '" + EntityFolder.ARCHIVE + "' THEN" + + " CASE WHEN :filter_archive THEN 9 ELSE 0 END" + " ELSE 999 END") // The folder type sort order should match the duplicate algorithm DataSource.Factory pagedThread(