Allow configuring account without drafts folder

This commit is contained in:
M66B
2020-08-20 20:06:36 +02:00
parent 72827e45bb
commit 1d99df3f6f
13 changed files with 39 additions and 59 deletions

View File

@@ -32,18 +32,22 @@ public interface DaoIdentity {
@Query(TupleIdentityView.query)
LiveData<List<TupleIdentityView>> liveIdentityView();
@Query("SELECT identity.*, account.name AS accountName FROM identity" +
" JOIN account ON account.id = identity.account")
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" LEFT JOIN folder ON folder.account = account.id AND folder.type = '" + EntityFolder.DRAFTS + "'")
LiveData<List<TupleIdentityEx>> liveIdentities();
@Query("SELECT identity.*, account.name AS accountName FROM identity" +
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +
" AND identity.synchronize" +
" AND account.synchronize")
LiveData<List<TupleIdentityEx>> liveComposableIdentities();
@Query("SELECT identity.*, account.name AS accountName FROM identity" +
@Query("SELECT identity.*, account.name AS accountName, folder.id AS drafts" +
" FROM identity" +
" JOIN account ON account.id = identity.account" +
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +
" WHERE (:account IS NULL OR account.id = :account)" +