Search identity on canonical address too

pull/146/head
M66B 6 years ago
parent 24eca867b2
commit 5fb28b6d3b

@ -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;

Loading…
Cancel
Save