|
|
@ -3904,8 +3904,8 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
if (iid >= 0)
|
|
|
|
if (iid >= 0)
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
if (identity.id.equals(iid)) {
|
|
|
|
if (identity.id.equals(iid)) {
|
|
|
|
Log.i("Selected requested identity=" + iid);
|
|
|
|
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
|
|
|
|
EntityLog.log(context, "Selected requested identity=" + iid);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3918,7 +3918,7 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
if (identity.account.equals(aid) &&
|
|
|
|
if (identity.account.equals(aid) &&
|
|
|
|
identity.sameAddress(sender)) {
|
|
|
|
identity.sameAddress(sender)) {
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
Log.i("Selected same account/identity");
|
|
|
|
EntityLog.log(context, "Selected same account/identity");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3928,7 +3928,7 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
if (identity.account.equals(aid) &&
|
|
|
|
if (identity.account.equals(aid) &&
|
|
|
|
identity.similarAddress(sender)) {
|
|
|
|
identity.similarAddress(sender)) {
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
Log.i("Selected similar account/identity");
|
|
|
|
EntityLog.log(context, "Selected similar account/identity");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3937,7 +3937,7 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
if (identity.sameAddress(sender)) {
|
|
|
|
if (identity.sameAddress(sender)) {
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
Log.i("Selected same */identity");
|
|
|
|
EntityLog.log(context, "Selected same */identity");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3946,7 +3946,7 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
if (identity.similarAddress(sender)) {
|
|
|
|
if (identity.similarAddress(sender)) {
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
Log.i("Selected similer */identity");
|
|
|
|
EntityLog.log(context, "Selected similer */identity");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3955,7 +3955,7 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
if (identity.account.equals(aid) && identity.primary) {
|
|
|
|
if (identity.account.equals(aid) && identity.primary) {
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
Log.i("Selected primary account/identity");
|
|
|
|
EntityLog.log(context, "Selected primary account/identity");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3963,28 +3963,30 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
if (identity.account.equals(aid)) {
|
|
|
|
if (identity.account.equals(aid)) {
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
Log.i("Selected account/identity");
|
|
|
|
EntityLog.log(context, "Selected account/identity");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (selected == null)
|
|
|
|
if (selected == null)
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
for (EntityIdentity identity : data.identities)
|
|
|
|
if (identity.primary) {
|
|
|
|
if (identity.primary) {
|
|
|
|
Log.i("Selected primary */identity");
|
|
|
|
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
|
|
|
|
EntityLog.log(context, "Selected primary */identity");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (selected == null)
|
|
|
|
if (selected == null)
|
|
|
|
for (EntityIdentity identity : data.identities) {
|
|
|
|
for (EntityIdentity identity : data.identities) {
|
|
|
|
Log.i("Selected */identity");
|
|
|
|
|
|
|
|
selected = identity;
|
|
|
|
selected = identity;
|
|
|
|
|
|
|
|
EntityLog.log(context, "Selected */identity");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (selected == null)
|
|
|
|
if (selected == null)
|
|
|
|
throw new IllegalArgumentException(context.getString(R.string.title_no_composable));
|
|
|
|
throw new IllegalArgumentException(context.getString(R.string.title_no_composable));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EntityLog.log(context, "Selected=" + selected.email);
|
|
|
|
|
|
|
|
|
|
|
|
if (plain_only)
|
|
|
|
if (plain_only)
|
|
|
|
data.draft.plain_only = true;
|
|
|
|
data.draft.plain_only = true;
|
|
|
|
|
|
|
|
|
|
|
@ -4100,6 +4102,8 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
Address preferred = null;
|
|
|
|
Address preferred = null;
|
|
|
|
if (ref.identity != null) {
|
|
|
|
if (ref.identity != null) {
|
|
|
|
EntityIdentity recognized = db.identity().getIdentity(ref.identity);
|
|
|
|
EntityIdentity recognized = db.identity().getIdentity(ref.identity);
|
|
|
|
|
|
|
|
EntityLog.log(context, "Recognized=" + (recognized == null ? null : recognized.email));
|
|
|
|
|
|
|
|
|
|
|
|
if (recognized != null) {
|
|
|
|
if (recognized != null) {
|
|
|
|
Address same = null;
|
|
|
|
Address same = null;
|
|
|
|
Address similar = null;
|
|
|
|
Address similar = null;
|
|
|
@ -4122,13 +4126,22 @@ public class FragmentCompose extends FragmentBase {
|
|
|
|
Log.w(ex);
|
|
|
|
Log.w(ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EntityLog.log(context, "From=" + MessageHelper.formatAddresses(data.draft.from) +
|
|
|
|
|
|
|
|
" delivered-to=" + ref.deliveredto +
|
|
|
|
|
|
|
|
" same=" + (same == null ? null : ((InternetAddress) same).getAddress()) +
|
|
|
|
|
|
|
|
" similar=" + (similar == null ? null : ((InternetAddress) similar).getAddress()));
|
|
|
|
|
|
|
|
|
|
|
|
preferred = (same == null ? similar : same);
|
|
|
|
preferred = (same == null ? similar : same);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
|
|
|
|
EntityLog.log(context, "Recognized=null");
|
|
|
|
|
|
|
|
|
|
|
|
if (preferred != null) {
|
|
|
|
if (preferred != null) {
|
|
|
|
String from = ((InternetAddress) preferred).getAddress();
|
|
|
|
String from = ((InternetAddress) preferred).getAddress();
|
|
|
|
|
|
|
|
EntityLog.log(context, "preferred=" + from);
|
|
|
|
data.draft.extra = UriHelper.getEmailUser(from);
|
|
|
|
data.draft.extra = UriHelper.getEmailUser(from);
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
|
|
|
|
EntityLog.log(context, "preferred=null");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|