From 283508c4412486e28286378183a36124ba11057f Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 18 Nov 2019 10:23:24 +0100 Subject: [PATCH] Run exists last on sent --- app/src/main/java/eu/faircode/email/ServiceSend.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSend.java b/app/src/main/java/eu/faircode/email/ServiceSend.java index ae2f0edd16..fff03e78e1 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSend.java +++ b/app/src/main/java/eu/faircode/email/ServiceSend.java @@ -435,10 +435,6 @@ public class ServiceSend extends ServiceBase { db.message().setMessageSize(sid, size, total); db.message().setMessageSent(sid, time); db.message().setMessageUiHide(sid, false); - - // Check for sent orphans - EntityMessage orphan = db.message().getMessage(sid); - EntityOperation.queue(this, orphan, EntityOperation.EXISTS); } if (message.inreplyto != null) { @@ -447,6 +443,12 @@ public class ServiceSend extends ServiceBase { EntityOperation.queue(this, replied, EntityOperation.ANSWERED, true); } + if (sid != null) { + // Check for sent orphans + EntityMessage orphan = db.message().getMessage(sid); + EntityOperation.queue(this, orphan, EntityOperation.EXISTS); + } + db.setTransactionSuccessful(); } finally { db.endTransaction();