1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 18:59:01 +00:00

Select identity for debug info

This commit is contained in:
M66B 2019-01-18 19:32:44 +00:00
parent 8fe8def583
commit 380abd5298

View file

@ -309,9 +309,20 @@ public class Helper {
if (drafts == null)
throw new IllegalArgumentException(context.getString(R.string.title_no_primary_drafts));
List<EntityIdentity> identities = db.identity().getIdentities(drafts.account);
EntityIdentity primary = null;
for (EntityIdentity identity : identities) {
if (identity.primary) {
primary = identity;
break;
} else if (primary == null)
primary = identity;
}
draft = new EntityMessage();
draft.account = drafts.account;
draft.folder = drafts.id;
draft.identity = (primary == null ? null : primary.id);
draft.msgid = EntityMessage.generateMessageId();
draft.to = new Address[]{Helper.myAddress()};
draft.subject = context.getString(R.string.app_name) + " " + BuildConfig.VERSION_NAME + " debug info";