Match delivered-to for extra

This commit is contained in:
M66B 2020-02-11 10:53:46 +01:00
parent e971d725c5
commit bb409d608a
1 changed files with 13 additions and 0 deletions

View File

@ -2935,12 +2935,25 @@ public class FragmentCompose extends FragmentBase {
if (recognized != null) {
Address same = null;
Address similar = null;
for (Address from : data.draft.from) {
if (same == null && recognized.sameAddress(from))
same = from;
if (similar == null && recognized.similarAddress(from))
similar = from;
}
if (ref.deliveredto != null)
try {
Address deliveredto = new InternetAddress(ref.deliveredto);
if (same == null && recognized.sameAddress(deliveredto))
same = deliveredto;
if (similar == null && recognized.similarAddress(deliveredto))
similar = deliveredto;
} catch (AddressException ex) {
Log.w(ex);
}
preferred = (same == null ? similar : same);
}
}