From 6c1a42e03292d725abb53cd1a47b1a9f61177167 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 15 Dec 2018 09:16:47 +0100 Subject: [PATCH] Sort archive folder after original message --- 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 2eb765aeb6..d00881720f 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -133,7 +133,8 @@ public interface DaoMessage { " AND message.thread = :thread" + " AND (:id IS NULL OR message.id = :id)" + " AND (NOT message.ui_hide OR :debug)" + - " ORDER BY message.received DESC") + " ORDER BY message.received DESC" + + ", CASE WHEN folder.type = '" + EntityFolder.ARCHIVE + "' THEN 1 ELSE 0 END") DataSource.Factory pagedThread(long account, String thread, Long id, boolean debug); @Query("SELECT COUNT(id)" +