Outbox: set received time to snoozed time

This commit is contained in:
M66B 2022-03-18 15:31:18 +01:00
parent 1c36a945bf
commit 13b8cf5791
1 changed files with 11 additions and 9 deletions

View File

@ -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);