From 5d86ae6df2e8e597dc5335a4f7c8ea6bb11b1257 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 13 Aug 2018 18:54:16 +0000 Subject: [PATCH] Open system folders first --- app/src/main/java/eu/faircode/email/DaoFolder.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DaoFolder.java b/app/src/main/java/eu/faircode/email/DaoFolder.java index f073ce7bc3..72f8c8cfae 100644 --- a/app/src/main/java/eu/faircode/email/DaoFolder.java +++ b/app/src/main/java/eu/faircode/email/DaoFolder.java @@ -31,10 +31,15 @@ public interface DaoFolder { @Query("SELECT * FROM folder WHERE account = :account") List getFolders(long account); - @Query("SELECT * FROM folder WHERE account = :account AND synchronize = :synchronize") + @Query("SELECT * FROM folder" + + " WHERE account = :account" + + " AND synchronize = :synchronize" + + " ORDER BY CASE WHEN folder.type = '" + EntityFolder.USER + "' THEN 1 ELSE 0 END") List getFolders(long account, boolean synchronize); - @Query("SELECT * FROM folder WHERE account = :account AND type = '" + EntityFolder.USER + "'") + @Query("SELECT * FROM folder" + + " WHERE account = :account" + + " AND type = '" + EntityFolder.USER + "'") List getUserFolders(long account); @Query("SELECT folder.*, account.name AS accountName" +