From 76cc0027a16b5a242b733d80d92844bb897bc287 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 19 Sep 2019 21:47:19 +0200 Subject: [PATCH] Small improvement --- app/src/main/java/eu/faircode/email/Core.java | 11 ++++++++++- 1 file changed, 10 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 b538481727..2be8412bc3 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -213,6 +213,7 @@ class Core { case EntityOperation.ANSWERED: case EntityOperation.ADD: case EntityOperation.EXISTS: + // Do nothing break; case EntityOperation.DELETE: onDelete(context, jargs, folder, message, (POP3Folder) ifolder); @@ -428,7 +429,8 @@ class Core { // Mark message (un)seen DB db = DB.getInstance(context); - db.message().setMessageUiSeen(folder.id, jargs.getBoolean(0)); + boolean seen = jargs.getBoolean(0); + db.message().setMessageUiSeen(folder.id, seen); } private static void onFlag(Context context, JSONArray jargs, EntityFolder folder, EntityMessage message, IMAPFolder ifolder) throws MessagingException, JSONException { @@ -1214,6 +1216,8 @@ class Core { Uri lookupUri = ContactInfo.getLookupUri(context, message.from); message.avatar = (lookupUri == null ? null : lookupUri.toString()); + // No MX check + try { db.beginTransaction(); @@ -1231,6 +1235,8 @@ class Core { attachment.id = db.attachment().insertAttachment(attachment); } + // No rules + db.setTransactionSuccessful(); } finally { db.endTransaction(); @@ -1247,6 +1253,9 @@ class Core { for (EntityAttachment attachment : parts.getAttachments()) parts.downloadAttachment(context, attachment); + if (message.received > account.created) + updateContactInfo(context, folder, message); + } catch (Throwable ex) { db.folder().setFolderError(folder.id, Helper.formatThrowable(ex)); } finally {