From 3ddaab419f3a2b977d999ebb855ad63a35f5c6cd Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 8 Dec 2021 20:10:19 +0100 Subject: [PATCH] Refactoring --- app/src/main/java/eu/faircode/email/EntityRule.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 3c65eceb61..bf675e421a 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -125,10 +125,14 @@ public class EntityRule { private static ExecutorService executor = Helper.getBackgroundExecutor(1, "rule"); static boolean needsHeaders(List rules) { + return needs(rules, "header"); + } + + private static boolean needs(List rules, String what) { for (EntityRule rule : rules) try { JSONObject jcondition = new JSONObject(rule.condition); - if (jcondition.has("header")) + if (jcondition.has(what)) return true; } catch (Throwable ex) { Log.e(ex);