From 53868387ec5803817983ab7cd4303c2af953d38c Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 6 Jul 2021 08:13:31 +0200 Subject: [PATCH] Fixed notify clear --- app/src/main/java/eu/faircode/email/DaoMessage.java | 10 +++++++--- app/src/main/java/eu/faircode/email/ServiceUI.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 8425ed0b88..49ef22c5e0 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -773,11 +773,15 @@ public interface DaoMessage { int setMessageLastAttempt(long id, long last_attempt); @Query("UPDATE message SET ui_ignored = 1" + - " WHERE (:account IS NULL OR account = :account)" + - " AND NOT ui_ignored" + + " WHERE NOT ui_ignored" + + " AND account IN (" + + " SELECT id FROM account" + + " WHERE :folder IS NOT NULL" + + " OR id = :account" + + " OR (:account IS NULL AND NOT account.notify))" + " AND folder IN (" + " SELECT id FROM folder" + - " WHERE (:folder IS NULL AND folder.unified) OR id = :folder)") + " WHERE :folder IS NULL OR id = :folder)") int ignoreAll(Long account, Long folder); @Query("UPDATE message SET ui_found = 1 WHERE id = :id AND NOT (ui_found IS 1)") diff --git a/app/src/main/java/eu/faircode/email/ServiceUI.java b/app/src/main/java/eu/faircode/email/ServiceUI.java index 18abe43101..f8b3792b8c 100644 --- a/app/src/main/java/eu/faircode/email/ServiceUI.java +++ b/app/src/main/java/eu/faircode/email/ServiceUI.java @@ -187,7 +187,7 @@ public class ServiceUI extends IntentService { cleared = db.message().ignoreAll(null, -group); else cleared = db.message().ignoreAll(group == 0 ? null : group, null); - Log.i("Cleared=" + cleared); + EntityLog.log(this, "Notify clear group=" + group + " cleared=" + cleared); } private void cancel(long group, long id) {