Show selected folders in navigation menu

This commit is contained in:
M66B
2019-04-29 10:14:55 +02:00
parent 3f391a2ddd
commit 6fdc1cae50
28 changed files with 2954 additions and 583 deletions

View File

@@ -82,6 +82,18 @@ public interface DaoFolder {
" GROUP BY folder.id")
LiveData<List<TupleFolderEx>> liveUnified();
@Query("SELECT folder.*" +
", account.color" +
", SUM(CASE WHEN message.ui_seen = 0 THEN 1 ELSE 0 END) AS unseen" +
", (SELECT COUNT(*) FROM operation WHERE operation.folder = folder.id) AS operations" +
" FROM folder" +
" LEFT JOIN account ON account.id = folder.account" +
" LEFT JOIN message ON message.folder = folder.id AND NOT message.ui_hide" +
" WHERE account.id IS NULL" +
" OR (account.`synchronize` AND folder.navigation)" +
" GROUP BY folder.id")
LiveData<List<TupleFolderNav>> liveNavigation();
@Query("SELECT folder.* FROM folder" +
" JOIN account ON account.id = folder.account" +
" WHERE account.synchronize" +
@@ -180,6 +192,7 @@ public interface DaoFolder {
@Query("UPDATE folder" +
" SET display = :display" +
", unified = :unified" +
", navigation = :navigation" +
", notify = :notify" +
", hide = :hide" +
", synchronize = :synchronize" +
@@ -190,7 +203,7 @@ public interface DaoFolder {
" WHERE id = :id")
int setFolderProperties(
long id,
String display, boolean unified, boolean notify, boolean hide,
String display, boolean unified, boolean navigation, boolean notify, boolean hide,
boolean synchronize, boolean poll, boolean download,
int sync_days, int keep_days);