Refactoring

This commit is contained in:
M66B 2019-03-31 08:48:42 +02:00
parent ff01c421fa
commit 248a47be2c
1 changed files with 18 additions and 18 deletions

View File

@ -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,