From c535df7e622856544778cdbeaca370e8c2de6a00 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 27 Jan 2020 13:59:05 +0100 Subject: [PATCH] Filter system keywords --- .../java/eu/faircode/email/AdapterMessage.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 6a70b698fa..8ffdf9e811 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -259,6 +259,11 @@ public class AdapterMessage extends RecyclerView.Adapter IMAP_KEYWORDS = Collections.unmodifiableList(Arrays.asList( + "$Phishing" + )); + public class ViewHolder extends RecyclerView.ViewHolder implements View.OnKeyListener, View.OnClickListener, @@ -863,8 +868,13 @@ public class AdapterMessage extends RecyclerView.Adapter 0 ? View.VISIBLE : View.GONE); - tvKeywords.setText(TextUtils.join(" ", message.keywords)); + List keywords = new ArrayList<>(); + for (String keyword : message.keywords) + if (!keyword.startsWith("$") || IMAP_KEYWORDS.contains(keyword)) + keywords.add(keyword); + + tvKeywords.setVisibility(keywords.size() > 0 ? View.VISIBLE : View.GONE); + tvKeywords.setText(TextUtils.join(" ", keywords)); // Line 3 int icon = (message.drafts > 0