mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Refactoring
This commit is contained in:
parent
667affa583
commit
3ddaab419f
1 changed files with 5 additions and 1 deletions
|
@ -125,10 +125,14 @@ public class EntityRule {
|
|||
private static ExecutorService executor = Helper.getBackgroundExecutor(1, "rule");
|
||||
|
||||
static boolean needsHeaders(List<EntityRule> rules) {
|
||||
return needs(rules, "header");
|
||||
}
|
||||
|
||||
private static boolean needs(List<EntityRule> 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);
|
||||
|
|
Loading…
Reference in a new issue