Search identity on canonical address too

This commit is contained in:
M66B
2018-11-10 17:24:54 +00:00
parent 24eca867b2
commit 5fb28b6d3b

View File

@@ -1870,10 +1870,14 @@ public class ServiceSynchronize extends LifecycleService {
}
if (message == null) {
Address[] to = helper.getTo();
Address[] tos = helper.getTo();
EntityIdentity identity = null;
if (to != null && to.length > 0)
identity = db.identity().getIdentity(folder.account, ((InternetAddress) to[0]).getAddress());
if (tos != null && tos.length > 0) {
String to = ((InternetAddress) tos[0]).getAddress();
identity = db.identity().getIdentity(folder.account, to);
if (identity == null)
identity = db.identity().getIdentity(folder.account, Helper.canonicalAddress(to));
}
message = new EntityMessage();
message.account = folder.account;