Fixed selecting identity with multiple recipients

This commit is contained in:
M66B 2019-02-04 17:32:07 +00:00
parent 0f8e958935
commit 1ebf77edd1
1 changed files with 20 additions and 17 deletions

View File

@ -1625,11 +1625,11 @@ public class FragmentCompose extends FragmentBase {
// Select identity matching from address
int icount = 0;
String from = null;
EntityIdentity first = null;
EntityIdentity primary = null;
if (result.draft.from != null && result.draft.from.length > 0)
from = Helper.canonicalAddress(((InternetAddress) result.draft.from[0]).getAddress());
if (result.draft.from != null)
for (Address afrom : result.draft.from) {
String from = Helper.canonicalAddress(((InternetAddress) afrom).getAddress());
for (EntityIdentity identity : identities) {
String email = Helper.canonicalAddress(identity.email);
if (email.equals(from)) {
@ -1645,6 +1645,9 @@ public class FragmentCompose extends FragmentBase {
first = identity;
}
}
if (result.draft.identity != null)
break;
}
// Select primary identity
if (result.draft.identity == null) {