Postpone deleting drafts

pull/212/head
M66B 2 years ago
parent 5cfbeafa82
commit 39acde4025

@ -6477,9 +6477,6 @@ public class FragmentCompose extends FragmentBase {
} }
} else if (action == R.id.action_send) { } else if (action == R.id.action_send) {
// Delete draft (cannot move to outbox)
EntityOperation.queue(context, draft, EntityOperation.DELETE);
EntityFolder outbox = db.folder().getOutbox(); EntityFolder outbox = db.folder().getOutbox();
if (outbox == null) { if (outbox == null) {
Log.w("Outbox missing"); Log.w("Outbox missing");
@ -6499,6 +6496,8 @@ public class FragmentCompose extends FragmentBase {
draft.received = draft.ui_snoozed; draft.received = draft.ui_snoozed;
// Copy message to outbox // Copy message to outbox
long did = draft.id;
draft.id = null; draft.id = null;
draft.folder = outbox.id; draft.folder = outbox.id;
draft.uid = null; draft.uid = null;
@ -6515,6 +6514,11 @@ public class FragmentCompose extends FragmentBase {
if (draft.ui_snoozed == null) if (draft.ui_snoozed == null)
EntityOperation.queue(context, draft, EntityOperation.SEND); EntityOperation.queue(context, draft, EntityOperation.SEND);
// Delete draft (cannot move to outbox)
EntityMessage tbd = db.message().getMessage(did);
if (tbd != null)
EntityOperation.queue(context, tbd, EntityOperation.DELETE);
final String feedback; final String feedback;
if (draft.ui_snoozed == null) { if (draft.ui_snoozed == null) {
boolean suitable = ConnectionHelper.getNetworkState(context).isSuitable(); boolean suitable = ConnectionHelper.getNetworkState(context).isSuitable();

Loading…
Cancel
Save