From 436dd06d08082c50b69e928df78ca2607834dcf5 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 25 Feb 2021 17:46:33 +0100 Subject: [PATCH] Sort archived messages on top when viewing the archive folder --- app/src/main/java/eu/faircode/email/DaoMessage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(