mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 11:55:20 +01:00
Undo save: optional add operation
This commit is contained in:
@@ -294,6 +294,9 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
||||
static Long undoSend(long id, Context context) {
|
||||
DB db = DB.getInstance(context);
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean save_drafts = prefs.getBoolean("save_drafts", true);
|
||||
|
||||
// Cancel send
|
||||
EntityOperation operation = db.operation().getOperation(id, EntityOperation.SEND);
|
||||
if (operation != null)
|
||||
@@ -336,7 +339,10 @@ public class ActivityCompose extends ActivityBase implements FragmentManager.OnB
|
||||
for (EntityAttachment attachment : attachments)
|
||||
db.attachment().setMessage(attachment.id, message.id);
|
||||
|
||||
EntityOperation.queue(context, message, EntityOperation.ADD);
|
||||
if (save_drafts &&
|
||||
(message.ui_encrypt == null ||
|
||||
EntityMessage.ENCRYPT_NONE.equals(message.ui_encrypt)))
|
||||
EntityOperation.queue(context, message, EntityOperation.ADD);
|
||||
|
||||
// Delete from outbox
|
||||
db.message().deleteMessage(id); // will delete operation too
|
||||
|
||||
Reference in New Issue
Block a user