From 07f3a1248b071231b2a266f176c93484b9759f7b Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 10 Aug 2020 13:55:45 +0200 Subject: [PATCH] Sync after purge --- app/src/main/java/eu/faircode/email/FragmentFolders.java | 7 +++++-- app/src/main/java/eu/faircode/email/FragmentMessages.java | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index a4b6f76ea4..9cad6ba3a9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -701,12 +701,15 @@ public class FragmentFolders extends FragmentBase { List ids = db.message().getMessageByFolder(folder.id); for (Long id : ids) { EntityMessage message = db.message().getMessage(id); - if (message != null && - (account.protocol == EntityAccount.TYPE_POP || message.uid != null)) + if (message == null) + continue; + + if (message.uid != null || account.protocol == EntityAccount.TYPE_POP) db.message().setMessageUiHide(message.id, true); } EntityOperation.queue(context, folder, EntityOperation.PURGE); + EntityOperation.sync(context, folder.id, false); db.setTransactionSuccessful(); } finally { diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index fb390b9886..1d77658bc4 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -7098,12 +7098,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. List ids = db.message().getMessageByFolder(folder.id); for (Long id : ids) { EntityMessage message = db.message().getMessage(id); - if (message != null && - (account.protocol == EntityAccount.TYPE_POP || message.uid != null)) + if (message == null) + continue; + + if (message.uid != null || account.protocol == EntityAccount.TYPE_POP) db.message().setMessageUiHide(message.id, true); } EntityOperation.queue(context, folder, EntityOperation.PURGE); + EntityOperation.sync(context, folder.id, false); } db.setTransactionSuccessful();