From a3179562bf8e44d0aae9da8897cfd3baa83e75eb Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 24 Nov 2018 21:05:13 +0100 Subject: [PATCH] Set flags in real-time --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 6df7046fcd..eb442c3134 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1429,6 +1429,7 @@ public class ServiceSynchronize extends LifecycleService { throw new MessageRemovedException(); imessage.setFlag(Flags.Flag.SEEN, seen); + ifolder.setFlags(new Message[]{imessage}, new Flags(Flags.Flag.SEEN), seen); db.message().setMessageSeen(message.id, seen); } @@ -1444,6 +1445,7 @@ public class ServiceSynchronize extends LifecycleService { throw new MessageRemovedException(); imessage.setFlag(Flags.Flag.ANSWERED, answered); + ifolder.setFlags(new Message[]{imessage}, new Flags(Flags.Flag.ANSWERED), answered); db.message().setMessageAnswered(message.id, answered); } @@ -1456,6 +1458,7 @@ public class ServiceSynchronize extends LifecycleService { throw new MessageRemovedException(); imessage.setFlag(Flags.Flag.FLAGGED, flagged); + ifolder.setFlags(new Message[]{imessage}, new Flags(Flags.Flag.FLAGGED), flagged); db.message().setMessageFlagged(message.id, flagged); } @@ -1472,6 +1475,7 @@ public class ServiceSynchronize extends LifecycleService { if (iprev != null) { Log.i(Helper.TAG, "Deleting existing uid=" + message.uid); iprev.setFlag(Flags.Flag.DELETED, true); + ifolder.setFlags(new Message[]{iprev}, new Flags(Flags.Flag.DELETED), true); ifolder.expunge(); } } @@ -1497,6 +1501,7 @@ public class ServiceSynchronize extends LifecycleService { if (!EntityFolder.ARCHIVE.equals(folder.type)) { imessage.setFlag(Flags.Flag.DELETED, true); + ifolder.setFlags(new Message[]{imessage}, new Flags(Flags.Flag.DELETED), true); ifolder.expunge(); } @@ -1513,6 +1518,7 @@ public class ServiceSynchronize extends LifecycleService { throw new MessageRemovedException(); imessage.setFlag(Flags.Flag.DELETED, true); + ifolder.setFlags(new Message[]{imessage}, new Flags(Flags.Flag.DELETED), true); ifolder.expunge(); db.message().deleteMessage(message.id);