From d49f1ac7287c7ec80edb0df9f29f9aa5d2645817 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 24 Aug 2022 08:14:41 +0200 Subject: [PATCH] Added priority condition --- FAQ.md | 2 ++ app/src/main/java/eu/faircode/email/EntityRule.java | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/FAQ.md b/FAQ.md index 986943d2ee..6e5e56c0c5 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2624,6 +2624,8 @@ $$replydomain$ $$nofrom$ (since version 1.1791) $$multifrom$ (since version 1.1791) $$automatic$ (since version 1.1862) +$$lowpriority (since version 1.1958) +$$highpriority (since version 1.1958) ``` Note that *regex* should be disable and that there should be no white space. diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 9fa7740e74..9b0ff7627c 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -306,6 +306,12 @@ public class EntityRule { } else if ("$automatic".equals(keyword)) { if (!Boolean.TRUE.equals(message.auto_submitted)) return false; + } else if ("$lowpriority".equals(keyword)) { + if (!EntityMessage.PRIORITIY_LOW.equals(message.priority)) + return false; + } else if ("$highpriority".equals(keyword)) { + if (!EntityMessage.PRIORITIY_HIGH.equals(message.priority)) + return false; } else { List keywords = new ArrayList<>(); keywords.addAll(Arrays.asList(message.keywords));