mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-28 08:46:01 +00:00
Prevent searching for self
This commit is contained in:
parent
84e3767f7d
commit
44690e8bfd
1 changed files with 13 additions and 7 deletions
|
@ -3856,24 +3856,30 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
if (folder == null)
|
||||
return null;
|
||||
|
||||
boolean ingoing = false;
|
||||
boolean outgoing = EntityFolder.isOutgoing(folder.type);
|
||||
|
||||
if (message.identity != null) {
|
||||
if (message.from != null && message.from.length > 0) {
|
||||
EntityIdentity identity = db.identity().getIdentity(message.identity);
|
||||
if (identity == null)
|
||||
return null;
|
||||
EntityIdentity identity = db.identity().getIdentity(message.identity);
|
||||
if (identity == null)
|
||||
return null;
|
||||
|
||||
if (message.to != null)
|
||||
for (Address recipient : message.to)
|
||||
if (identity.similarAddress(recipient)) {
|
||||
ingoing = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (message.from != null)
|
||||
for (Address sender : message.from)
|
||||
if (identity.similarAddress(sender)) {
|
||||
outgoing = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (outgoing && message.reply != null &&
|
||||
MessageHelper.equal(message.from, message.to))
|
||||
if (outgoing && ingoing && message.reply != null)
|
||||
return message.reply;
|
||||
|
||||
return (outgoing ? message.to : message.from);
|
||||
|
|
Loading…
Reference in a new issue