Match identities for sent messages

pull/146/head
M66B 6 years ago
parent 623ccaa522
commit acba8b20f9

@ -1870,16 +1870,18 @@ public class ServiceSynchronize extends LifecycleService {
}
if (message == null) {
Address[] tos = helper.getTo();
Address[] tos = (folder.isOutgoing() ? helper.getFrom() : helper.getTo());
EntityIdentity identity = null;
if (tos != null && tos.length > 0) {
String to = ((InternetAddress) tos[0]).getAddress();
if (!TextUtils.isEmpty(to)) {
to = to.toLowerCase();
identity = db.identity().getIdentity(folder.account, to);
if (identity == null)
identity = db.identity().getIdentity(folder.account, Helper.canonicalAddress(to));
if (identity == null) {
if (identity == null && !folder.isOutgoing()) {
to = helper.getDeliveredTo();
if (!TextUtils.isEmpty(to))
identity = db.identity().getIdentity(folder.account, to);

Loading…
Cancel
Save