|
|
|
@ -1627,9 +1627,12 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
int icount = 0;
|
|
|
|
|
EntityIdentity first = null;
|
|
|
|
|
EntityIdentity primary = null;
|
|
|
|
|
if (result.draft.from != null)
|
|
|
|
|
for (Address afrom : result.draft.from) {
|
|
|
|
|
String from = Helper.canonicalAddress(((InternetAddress) afrom).getAddress());
|
|
|
|
|
|
|
|
|
|
int iindex = -1;
|
|
|
|
|
do {
|
|
|
|
|
String from = null;
|
|
|
|
|
if (iindex >= 0)
|
|
|
|
|
from = Helper.canonicalAddress(((InternetAddress) result.draft.from[iindex]).getAddress());
|
|
|
|
|
for (EntityIdentity identity : identities) {
|
|
|
|
|
String email = Helper.canonicalAddress(identity.email);
|
|
|
|
|
if (email.equals(from)) {
|
|
|
|
@ -1647,9 +1650,11 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
|
}
|
|
|
|
|
if (result.draft.identity != null)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Select primary identity
|
|
|
|
|
iindex++;
|
|
|
|
|
} while (iindex < (result.draft.from == null ? -1 : result.draft.from.length));
|
|
|
|
|
|
|
|
|
|
// Select identity
|
|
|
|
|
if (result.draft.identity == null) {
|
|
|
|
|
if (primary != null) {
|
|
|
|
|
result.draft.identity = primary.id;
|
|
|
|
|