From 1e81f38e60c7a6b7d9f094b3666821a605e02b1e Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 24 Nov 2019 11:41:41 +0100 Subject: [PATCH] Better message removed handling --- app/src/main/java/eu/faircode/email/Core.java | 8 +++++++- 1 file changed, 7 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 5958011c70..31c09797ee 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -408,6 +408,8 @@ class Core { ex instanceof FolderNotFoundException || ex instanceof IllegalArgumentException || ex instanceof SQLiteConstraintException || + ex.getCause() instanceof MessageRemovedException || + ex.getCause() instanceof MessageRemovedIOException || ex.getCause() instanceof BadCommandException || ex.getCause() instanceof CommandFailedException) { // com.sun.mail.iap.BadCommandException: B13 BAD [TOOBIG] Message too large @@ -428,7 +430,11 @@ class Core { db.folder().setFolderSyncState(folder.id, null); // Cleanup messages - if (message != null && ex instanceof MessageRemovedException) { + if (message != null && + (ex instanceof MessageRemovedException || + ex instanceof MessageRemovedIOException || + ex.getCause() instanceof MessageRemovedException || + ex.getCause() instanceof MessageRemovedIOException)) { db.message().deleteMessage(message.id); for (EntityMessage m : similar.values()) db.message().deleteMessage(m.id);