Simplification

This commit is contained in:
M66B 2019-01-08 10:13:47 +00:00
parent 5b3626bebf
commit 1fd9e6d022
1 changed files with 3 additions and 8 deletions

View File

@ -2060,14 +2060,9 @@ public class FragmentCompose extends FragmentEx {
draft.id = db.message().insertMessage(draft); draft.id = db.message().insertMessage(draft);
draft.write(getContext(), body); draft.write(getContext(), body);
// Restore attachments // Move attachments
for (EntityAttachment attachment : attachments) { for (EntityAttachment attachment : attachments)
File file = EntityAttachment.getFile(context, attachment.id); db.attachment().setMessage(attachment.id, draft.id);
attachment.id = null;
attachment.message = draft.id;
attachment.id = db.attachment().insertAttachment(attachment);
Helper.copy(file, EntityAttachment.getFile(context, attachment.id));
}
if (draft.ui_snoozed == null) if (draft.ui_snoozed == null)
EntityOperation.queue(context, db, draft, EntityOperation.SEND); EntityOperation.queue(context, db, draft, EntityOperation.SEND);