From 5824876fe10e3242b52158a8afab580c15d8eef5 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 4 Jan 2021 09:32:22 +0100 Subject: [PATCH] Report new message after classification --- app/src/main/java/eu/faircode/email/Core.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 3dcd873a3a..4a4f96ee7c 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -2969,7 +2969,6 @@ class Core { if (download && !message.ui_hide && MessageClassifier.isEnabled(context) && MessageClassifier.canClassify(folder.type)) db.message().setMessageUiHide(message.id, true); - reportNewMessage(context, account, folder, message); db.setTransactionSuccessful(); } catch (SQLiteConstraintException ex) { @@ -3024,6 +3023,8 @@ class Core { reportEmptyMessage(context, state, account, istore); } } + + reportNewMessage(context, account, folder, message); } else { if (process) { EntityIdentity identity = matchIdentity(context, folder, message); @@ -3129,10 +3130,8 @@ class Core { db.message().updateMessage(message); - if (process) { + if (process) runRules(context, imessage, account, folder, message, rules); - reportNewMessage(context, account, folder, message); - } db.setTransactionSuccessful(); } finally { @@ -3144,6 +3143,9 @@ class Core { MessageClassifier.classify(message, null, context); } else Log.d(folder.name + " unchanged uid=" + uid); + + if (process) + reportNewMessage(context, account, folder, message); } if (syncSimilar && account.isGmail())