From c678e37bbf5b8a7c161d89d9929079baae5347b1 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 18 Dec 2019 15:46:15 +0100 Subject: [PATCH] Select primary account/identity --- app/src/main/java/eu/faircode/email/FragmentCompose.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 7463e9f3c4..9355d46de7 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2597,8 +2597,13 @@ public class FragmentCompose extends FragmentBase { long aid = args.getLong("account", -1); long iid = args.getLong("identity", -1); - if (aid < 0 && ref != null) - aid = ref.account; + if (aid < 0) + if (ref == null) { + EntityAccount primary = db.account().getPrimaryAccount(); + if (primary != null) + aid = primary.id; + } else + aid = ref.account; if (iid < 0 && ref != null && ref.identity != null) iid = ref.identity;