Match identity for sent messages

This commit is contained in:
M66B 2018-11-11 07:10:58 +00:00
parent acba8b20f9
commit 5f4d6bd9ab
1 changed files with 2 additions and 2 deletions

View File

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