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.write(getContext(), body);
// Restore attachments
for (EntityAttachment attachment : attachments) {
File file = EntityAttachment.getFile(context, attachment.id);
attachment.id = null;
attachment.message = draft.id;
attachment.id = db.attachment().insertAttachment(attachment);
Helper.copy(file, EntityAttachment.getFile(context, attachment.id));
}
// Move attachments
for (EntityAttachment attachment : attachments)
db.attachment().setMessage(attachment.id, draft.id);
if (draft.ui_snoozed == null)
EntityOperation.queue(context, db, draft, EntityOperation.SEND);