mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
ff01c421fa
commit
248a47be2c
|
@ -1304,6 +1304,24 @@ class Core {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void runRules(Context context, IMAPMessage imessage, EntityMessage message, List<EntityRule> rules) {
|
||||||
|
if (!Helper.isPro(context))
|
||||||
|
return;
|
||||||
|
|
||||||
|
DB db = DB.getInstance(context);
|
||||||
|
try {
|
||||||
|
for (EntityRule rule : rules)
|
||||||
|
if (rule.matches(context, message, imessage)) {
|
||||||
|
rule.execute(context, db, message);
|
||||||
|
if (rule.stop)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.e(ex);
|
||||||
|
db.message().setMessageError(message.id, Helper.formatThrowable(ex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void updateContactInfo(Context context, EntityFolder folder, EntityMessage message) {
|
private static void updateContactInfo(Context context, EntityFolder folder, EntityMessage message) {
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
|
|
||||||
|
@ -1360,24 +1378,6 @@ class Core {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void runRules(Context context, IMAPMessage imessage, EntityMessage message, List<EntityRule> rules) {
|
|
||||||
if (!Helper.isPro(context))
|
|
||||||
return;
|
|
||||||
|
|
||||||
DB db = DB.getInstance(context);
|
|
||||||
try {
|
|
||||||
for (EntityRule rule : rules)
|
|
||||||
if (rule.matches(context, message, imessage)) {
|
|
||||||
rule.execute(context, db, message);
|
|
||||||
if (rule.stop)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.e(ex);
|
|
||||||
db.message().setMessageError(message.id, Helper.formatThrowable(ex));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void downloadMessage(
|
static void downloadMessage(
|
||||||
Context context,
|
Context context,
|
||||||
EntityFolder folder, IMAPFolder ifolder,
|
EntityFolder folder, IMAPFolder ifolder,
|
||||||
|
|
Loading…
Reference in New Issue