mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 08:08:16 +02:00
Match identities for sent messages
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user