From 272d1adecb543d1556423a92a101875b3461a05d Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 25 Jun 2019 10:16:03 +0200 Subject: [PATCH] Invalidate headers on message add, delete, change --- 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 f25f9536bf..2cce3a1b44 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -845,6 +845,8 @@ public class ServiceSynchronize extends LifecycleService { } catch (Throwable ex) { Log.e(folder.name, ex); db.folder().setFolderError(folder.id, Helper.formatThrowable(ex)); + } finally { + ((IMAPMessage) imessage).invalidateHeaders(); } int count = ifolder.getMessageCount(); @@ -876,6 +878,8 @@ public class ServiceSynchronize extends LifecycleService { Log.i(folder.name + " deleted uid=" + uid + " count=" + count); } catch (MessageRemovedException ex) { Log.w(folder.name, ex); + } finally { + ((IMAPMessage) imessage).invalidateHeaders(); } int count = ifolder.getMessageCount(); @@ -933,6 +937,8 @@ public class ServiceSynchronize extends LifecycleService { } catch (Throwable ex) { Log.e(folder.name, ex); db.folder().setFolderError(folder.id, Helper.formatThrowable(ex)); + } finally { + ((IMAPMessage) e.getMessage()).invalidateHeaders(); } } catch (Throwable ex) { Log.e(folder.name, ex);