Use linked drafts folder

Fixes #28
This commit is contained in:
M66B
2018-08-08 11:21:19 +00:00
parent 94f0e866e1
commit 93f75af745
8 changed files with 28 additions and 70 deletions

View File

@@ -45,7 +45,7 @@ public interface DaoFolder {
" FROM folder" +
" LEFT JOIN account ON account.id = folder.account" +
" LEFT JOIN message ON message.folder = folder.id AND NOT message.ui_hide" +
" WHERE folder.account = :account" +
" WHERE folder.account = :account OR folder.account IS NULL" +
" GROUP BY folder.id")
LiveData<List<TupleFolderEx>> liveFolders(long account);
@@ -71,14 +71,12 @@ public interface DaoFolder {
" WHERE account = :account AND type = :type")
EntityFolder getFolderByType(long account, String type);
@Query("SELECT * FROM folder WHERE account IS NULL AND type = '" + EntityFolder.TYPE_DRAFTS + "'")
EntityFolder getLocalDrafts();
@Query("SELECT * FROM folder WHERE type = '" + EntityFolder.TYPE_OUTBOX + "'")
EntityFolder getOutbox();
@Query("SELECT folder.* FROM folder" +
" JOIN account ON account.id = folder.account" +
" WHERE account.`primary` AND type = :type ")
EntityFolder getPrimaryFolder(String type);
@Insert(onConflict = OnConflictStrategy.REPLACE)
long insertFolder(EntityFolder folder);