Browse Source

Open system folders first

main
M66B 6 years ago
parent
commit
5d86ae6df2
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      app/src/main/java/eu/faircode/email/DaoFolder.java

+ 7
- 2
app/src/main/java/eu/faircode/email/DaoFolder.java View File

@ -31,10 +31,15 @@ public interface DaoFolder {
@Query("SELECT * FROM folder WHERE account = :account") @Query("SELECT * FROM folder WHERE account = :account")
List<EntityFolder> getFolders(long account); List<EntityFolder> 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<EntityFolder> getFolders(long account, boolean synchronize); List<EntityFolder> 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<EntityFolder> getUserFolders(long account); List<EntityFolder> getUserFolders(long account);
@Query("SELECT folder.*, account.name AS accountName" + @Query("SELECT folder.*, account.name AS accountName" +


Loading…
Cancel
Save