Compare email address only of submitter

pull/191/head
M66B 4 years ago
parent 5d6b71dff6
commit 7edf30016e

@ -2163,7 +2163,7 @@ class Core {
message.ui_ignored = false; message.ui_ignored = false;
message.ui_browsed = false; message.ui_browsed = false;
if (MessageHelper.equal(message.submitter, message.from)) if (MessageHelper.equalEmail(message.submitter, message.from))
message.submitter = null; message.submitter = null;
if (message.size == null && message.total != null) if (message.size == null && message.total != null)
@ -2863,7 +2863,7 @@ class Core {
if (message.flagged) if (message.flagged)
message.color = color; message.color = color;
if (MessageHelper.equal(message.submitter, message.from)) if (MessageHelper.equalEmail(message.submitter, message.from))
message.submitter = null; message.submitter = null;
// Borrow reply name from sender name // Borrow reply name from sender name

@ -2707,6 +2707,23 @@ public class MessageHelper {
return Objects.equals(email1, email2); return Objects.equals(email1, email2);
} }
static boolean equalEmail(Address[] a1, Address[] a2) {
if (a1 == null && a2 == null)
return true;
if (a1 == null || a2 == null)
return false;
if (a1.length != a2.length)
return false;
for (int i = 0; i < a1.length; i++)
if (!equalEmail(a1[i], a2[i]))
return false;
return true;
}
static boolean equal(Address[] a1, Address[] a2) { static boolean equal(Address[] a1, Address[] a2) {
if (a1 == null && a2 == null) if (a1 == null && a2 == null)
return true; return true;

Loading…
Cancel
Save