From f73de9f5df3c859979f7fd1e993b10b91bc0dc15 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 31 Jan 2021 20:51:05 +0100 Subject: [PATCH] Cleanup failed seen and flag --- app/src/main/java/eu/faircode/email/Core.java | 1 + .../java/eu/faircode/email/EntityOperation.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 470b4ca2b6..a0db549efe 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -517,6 +517,7 @@ class Core { // Delete: NO [CANNOT] STORE It's not possible to perform specified operation // Delete: NO [UNAVAILABLE] EXPUNGE Backend error // Delete: NO mailbox selected READ-ONLY + // Flags: NO mailbox selected READ-ONLY // Keyword: NO STORE completed // Search: BAD command syntax error diff --git a/app/src/main/java/eu/faircode/email/EntityOperation.java b/app/src/main/java/eu/faircode/email/EntityOperation.java index 6ab8411dfe..aa52574b0a 100644 --- a/app/src/main/java/eu/faircode/email/EntityOperation.java +++ b/app/src/main/java/eu/faircode/email/EntityOperation.java @@ -464,9 +464,22 @@ public class EntityOperation { EntityLog.log(context, "Cleanup op=" + id + "/" + name + " folder=" + folder + " message=" + message); - if (message != null) + if (message != null) { db.message().setMessageUiHide(message, false); + if (EntityOperation.SEEN.equals(name)) { + EntityMessage m = db.message().getMessage(message); + if (m != null) + db.message().setMessageUiSeen(m.id, m.seen); + } + + if (EntityOperation.FLAG.equals(name)) { + EntityMessage m = db.message().getMessage(message); + if (m != null) + db.message().setMessageUiFlagged(m.id, m.flagged, m.color); + } + } + if (EntityOperation.MOVE.equals(name) || EntityOperation.ADD.equals(name) || EntityOperation.RAW.equals(name))