diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 1923871065..094ace3a34 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -3169,6 +3169,8 @@ public class AdapterMessage extends RecyclerView.Adapter>() { @Override protected List onExecute(Context context, Bundle args) { + long id = args.getLong("id"); + EntityMessage message; List folders = null; @@ -3176,14 +3178,12 @@ public class AdapterMessage extends RecyclerView.Adapter attachments = db.attachment().getAttachments(id); + List attachments = db.attachment().getAttachments(message.id); for (EntityAttachment attachment : attachments) db.attachment().setMessage(attachment.id, message.id); EntityOperation.queue(context, message, EntityOperation.ADD); // Delete from outbox - db.message().deleteMessage(id); + db.message().deleteMessage(message.id); } else folders = db.folder().getFolders(message.account);