From 13b8cf579130ec0f7728fe546b19c4db8e421077 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 18 Mar 2022 15:31:18 +0100 Subject: [PATCH] Outbox: set received time to snoozed time --- .../eu/faircode/email/FragmentCompose.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 323f98bd52..ee86c7cd20 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -5966,6 +5966,17 @@ public class FragmentCompose extends FragmentBase { outbox.id = db.folder().insertFolder(outbox); } + // Delay sending message + if (draft.ui_snoozed == null && send_delayed != 0) { + if (extras.getBoolean("now")) + draft.ui_snoozed = null; + else + draft.ui_snoozed = new Date().getTime() + send_delayed * 1000L; + } + + if (draft.ui_snoozed != null) + draft.received = draft.ui_snoozed; + // Copy message to outbox draft.id = null; draft.folder = outbox.id; @@ -5979,15 +5990,6 @@ public class FragmentCompose extends FragmentBase { for (EntityAttachment attachment : attachments) db.attachment().setMessage(attachment.id, draft.id); - // Delay sending message - if (draft.ui_snoozed == null && send_delayed != 0) { - if (extras.getBoolean("now")) - draft.ui_snoozed = null; - else - draft.ui_snoozed = new Date().getTime() + send_delayed * 1000L; - db.message().setMessageSnoozed(draft.id, draft.ui_snoozed); - } - // Send message if (draft.ui_snoozed == null) EntityOperation.queue(context, draft, EntityOperation.SEND);