MCPcopy Create free account
hub / github.com/M66B/FairEmail / run

Method run

app/src/main/java/eu/faircode/email/EntityRule.java:219–242  ·  view source on GitHub ↗
(Context context, List<EntityRule> rules,
                   EntityMessage message, boolean browsed, List<Header> headers, String html)

Source from the content-addressed store, hash-verified

217 }
218
219 static int run(Context context, List<EntityRule> rules,
220 EntityMessage message, boolean browsed, List<Header> headers, String html)
221 throws JSONException, MessagingException, IOException {
222 int applied = 0;
223
224 List<String> stopped = new ArrayList<>();
225 for (EntityRule rule : rules) {
226 if (rule.group != null && stopped.contains(rule.group))
227 continue;
228 if (rule.matches(context, message, headers, html)) {
229 if (rule.execute(context, message, browsed, html))
230 applied++;
231 if (rule.stop)
232 if (rule.group == null)
233 break;
234 else {
235 if (!stopped.contains(rule.group))
236 stopped.add(rule.group);
237 }
238 }
239 }
240
241 return applied;
242 }
243
244 boolean matches(Context context, EntityMessage message, List<Header> headers, String html) throws MessagingException {
245 try {

Callers 5

onExecuteMethod · 0.95
onRuleMethod · 0.95
runRulesMethod · 0.95
dailyMethod · 0.95
ruleMethod · 0.95

Calls 12

answerMethod · 0.95
formatThrowableMethod · 0.95
wMethod · 0.95
isInCallMethod · 0.95
isDndMethod · 0.95
speakMethod · 0.95
setMessageErrorMethod · 0.80
messageMethod · 0.80
containsMethod · 0.45
matchesMethod · 0.45
executeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected