mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-25 17:27:00 +00:00
Fixed saving drafts with selected identity
This commit is contained in:
parent
d97261796a
commit
2b5dd74721
2 changed files with 6 additions and 1 deletions
|
@ -48,6 +48,9 @@ public interface DaoIdentity {
|
|||
@Query("SELECT * FROM identity WHERE id = :id")
|
||||
LiveData<EntityIdentity> liveIdentity(long id);
|
||||
|
||||
@Query("SELECT * FROM identity WHERE account = :account AND `primary`")
|
||||
EntityIdentity getPrimaryIdentity(long account);
|
||||
|
||||
@Insert
|
||||
long insertIdentity(EntityIdentity identity);
|
||||
|
||||
|
|
|
@ -1054,7 +1054,9 @@ public class FragmentCompose extends FragmentEx {
|
|||
EntityOperation.queue(db, draft, EntityOperation.MOVE, trash.id);
|
||||
|
||||
} else if (action == R.id.action_save) {
|
||||
if (ato == null && acc == null && abcc == null &&
|
||||
EntityIdentity primary = db.identity().getPrimaryIdentity(draft.account);
|
||||
if ((primary == null || draft.identity == primary.id) &&
|
||||
ato == null && acc == null && abcc == null &&
|
||||
TextUtils.isEmpty(subject) &&
|
||||
TextUtils.isEmpty(body) &&
|
||||
db.attachment().getAttachmentCount(draft.id) == 0)
|
||||
|
|
Loading…
Reference in a new issue