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:
parent
fff98efced
commit
cb5e9827c4
1 changed files with 8 additions and 6 deletions
|
@ -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(", ");
|
||||
|
||||
|
|
Loading…
Reference in a new issue