Small improvement

pull/202/head
M66B 4 years ago
parent 7c224b4119
commit 771ff11ba8

@ -149,15 +149,17 @@ public class DnsBlockList {
} }
static Boolean isJunk(Context context, List<Address> addresses) { static Boolean isJunk(Context context, List<Address> addresses) {
boolean hasDomain = false;
for (Address address : addresses) { for (Address address : addresses) {
String email = ((InternetAddress) address).getAddress(); String email = ((InternetAddress) address).getAddress();
String domain = UriHelper.getEmailDomain(email); String domain = UriHelper.getEmailDomain(email);
if (domain == null) if (domain == null)
continue; continue;
hasDomain = true;
if (isJunk(context, domain, false, BLOCK_LISTS)) if (isJunk(context, domain, false, BLOCK_LISTS))
return true; return true;
} }
return false; return (hasDomain ? false : null);
} }
private static boolean isJunk(Context context, String host, boolean numeric, List<BlockList> blocklists) { private static boolean isJunk(Context context, String host, boolean numeric, List<BlockList> blocklists) {

Loading…
Cancel
Save