mirror of https://github.com/M66B/FairEmail.git
Filter self on not replying to self
If this sounds complicated: it is!
This commit is contained in:
parent
e75487f9fa
commit
93022cc19b
|
@ -3270,7 +3270,15 @@ public class FragmentCompose extends FragmentBase {
|
|||
// Prevent replying to self
|
||||
if (ref.replySelf(data.identities, ref.account)) {
|
||||
data.draft.from = ref.from;
|
||||
data.draft.to = ref.to;
|
||||
List<Address> tos = new ArrayList<>();
|
||||
if (ref.to != null)
|
||||
for (Address to : ref.to)
|
||||
for (EntityIdentity identity : data.identities)
|
||||
if (!Objects.equals(identity.account, ref.account) ||
|
||||
!identity.self ||
|
||||
!identity.similarAddress(to))
|
||||
tos.add(to);
|
||||
data.draft.to = (tos.size() == 0 ? null : tos.toArray(new Address[0]));
|
||||
} else {
|
||||
data.draft.from = ref.to;
|
||||
data.draft.to = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply);
|
||||
|
|
Loading…
Reference in New Issue