Case insensitive signers check

pull/215/head
M66B 7 months ago
parent 6019218e18
commit 5b88be244e

@ -2649,9 +2649,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
signers.append(signer);
for (Address a : envelop) {
String domain = UriHelper.getEmailDomain(((InternetAddress) a).getAddress());
if (domain != null && Objects.equals(
UriHelper.getRootDomain(context, signer),
UriHelper.getRootDomain(context, domain))) {
if (signer != null && domain != null && Objects.equals(
UriHelper.getRootDomain(context, signer.toLowerCase(Locale.ROOT)),
UriHelper.getRootDomain(context, domain.toLowerCase(Locale.ROOT)))) {
signers.setSpan(new ForegroundColorSpan(textColorLink), start, signers.length(), 0);
known_signer = true;
break;

@ -2648,15 +2648,14 @@ public class MessageHelper {
envelop.addAll(Arrays.asList(from));
if (smtp_from != null)
envelop.addAll(Arrays.asList(smtp_from));
for (String signer : signers) {
for (String signer : signers)
for (Address a : envelop) {
String domain = UriHelper.getEmailDomain(((InternetAddress) a).getAddress());
if (domain != null && Objects.equals(
UriHelper.getRootDomain(context, signer),
UriHelper.getRootDomain(context, domain)))
if (signer != null && domain != null && Objects.equals(
UriHelper.getRootDomain(context, signer.toLowerCase(Locale.ROOT)),
UriHelper.getRootDomain(context, domain.toLowerCase(Locale.ROOT))))
return true;
}
}
return false;
}

Loading…
Cancel
Save