1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-03 21:55:13 +00:00

Use keyword blacklist only

This commit is contained in:
M66B 2020-01-28 12:32:34 +01:00
parent fff98efced
commit cb5e9827c4

View file

@ -264,11 +264,14 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
));
// https://www.iana.org/assignments/imap-jmap-keywords/imap-jmap-keywords.xhtml
private static final List<String> IMAP_KEYWORDS_WHITELIST = Collections.unmodifiableList(Arrays.asList(
"$Phishing".toLowerCase()
));
private static final List<String> IMAP_KEYWORDS_BLACKLIST = Collections.unmodifiableList(Arrays.asList(
"$MDNSent".toLowerCase(),
"$Forwarded".toLowerCase(),
"$SubmitPending".toLowerCase(),
"$Submitted".toLowerCase(),
"$Junk".toLowerCase(),
"$NotJunk".toLowerCase(),
"$recent".toLowerCase(),
"DTAG_document".toLowerCase(),
"DTAG_image".toLowerCase()
));
@ -881,8 +884,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
SpannableStringBuilder keywords = new SpannableStringBuilder();
for (int i = 0; i < message.keywords.length; i++) {
String k = message.keywords[i].toLowerCase();
if (IMAP_KEYWORDS_WHITELIST.contains(k) ||
!(k.startsWith("$") || IMAP_KEYWORDS_BLACKLIST.contains(k))) {
if (!IMAP_KEYWORDS_BLACKLIST.contains(k)) {
if (keywords.length() > 0)
keywords.append(", ");