mirror of https://github.com/M66B/FairEmail.git
Limit identities to accounts with a drafts folder
This commit is contained in:
parent
f2d76246f3
commit
d3919e2b5b
|
@ -36,8 +36,9 @@ public interface DaoIdentity {
|
|||
|
||||
@Query("SELECT identity.*, account.name AS accountName FROM identity" +
|
||||
" JOIN account ON account.id = identity.account" +
|
||||
" JOIN folder ON folder.account = identity.account AND folder.type = '" + EntityFolder.DRAFTS + "'" +
|
||||
" WHERE NOT :synchronize OR account.synchronize")
|
||||
List<TupleIdentityEx> getIdentities(boolean synchronize);
|
||||
List<TupleIdentityEx> getComposableIdentities(boolean synchronize);
|
||||
|
||||
@Query("SELECT * FROM identity WHERE account = :account")
|
||||
List<EntityIdentity> getIdentities(long account);
|
||||
|
|
|
@ -1384,7 +1384,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
if ("edit".equals(action))
|
||||
throw new IllegalStateException("Draft not found hide=" + (result.draft != null));
|
||||
|
||||
List<TupleIdentityEx> identities = db.identity().getIdentities(true);
|
||||
List<TupleIdentityEx> identities = db.identity().getComposableIdentities(true);
|
||||
|
||||
EntityMessage ref = db.message().getMessage(reference);
|
||||
if (ref == null) {
|
||||
|
@ -1649,7 +1649,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
@Override
|
||||
protected List<TupleIdentityEx> onExecute(Context context, Bundle args) {
|
||||
DB db = DB.getInstance(context);
|
||||
List<TupleIdentityEx> identities = db.identity().getIdentities(true);
|
||||
List<TupleIdentityEx> identities = db.identity().getComposableIdentities(true);
|
||||
if (identities == null)
|
||||
identities = new ArrayList<>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue