Prevent duplicate addresses

pull/187/head
M66B 4 years ago
parent ebf162070e
commit 643c3853e1

@ -243,6 +243,15 @@ public class EntityMessage implements Serializable {
if (cc != null) if (cc != null)
addresses.addAll(Arrays.asList(cc)); addresses.addAll(Arrays.asList(cc));
// Filter from
if (from != null)
for (Address address : new ArrayList<>(addresses))
for (Address f : from)
if (MessageHelper.equalEmail(address, f)) {
addresses.remove(address);
break;
}
// Filter self // Filter self
if (identities != null) if (identities != null)
for (Address address : new ArrayList<>(addresses)) for (Address address : new ArrayList<>(addresses))

Loading…
Cancel
Save