Set recognized extra only

This commit is contained in:
M66B 2020-01-03 18:41:48 +01:00
parent c1efe7a9b3
commit 3c8773c915
2 changed files with 6 additions and 4 deletions

View File

@ -117,6 +117,9 @@ public class EntityIdentity {
if (other == null)
return false;
if (!other.contains("@") || !email.contains("@"))
return false;
return other.equalsIgnoreCase(email);
}

View File

@ -2814,11 +2814,10 @@ public class FragmentCompose extends FragmentBase {
preferred = (same == null ? similar : same);
}
}
if (preferred == null)
preferred = data.draft.from[0];
String from = ((InternetAddress) preferred).getAddress();
if (from != null && from.contains("@"))
if (preferred != null) {
String from = ((InternetAddress) preferred).getAddress();
data.draft.extra = from.substring(0, from.indexOf("@"));
}
}
}