1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 01:36:55 +00:00

Fixed composing message disappearing

This commit is contained in:
M66B 2018-09-03 17:48:48 +00:00
parent 2667816ecb
commit c49e24c8b4

View file

@ -910,17 +910,19 @@ public class ServiceSynchronize extends LifecycleService {
MimeMessage imessage = MessageHelper.from(this, message, attachments, isession); MimeMessage imessage = MessageHelper.from(this, message, attachments, isession);
AppendUID[] uid = ifolder.appendUIDMessages(new Message[]{imessage}); AppendUID[] uid = ifolder.appendUIDMessages(new Message[]{imessage});
if (message.uid != null) { Long old = message.uid;
Message iprev = ifolder.getMessageByUID(message.uid);
db.message().setMessageUid(message.id, uid[0].uid);
Log.i(Helper.TAG, "Appended uid=" + message.uid);
if (old != null) {
Message iprev = ifolder.getMessageByUID(old);
if (iprev != null) { if (iprev != null) {
Log.i(Helper.TAG, "Deleting existing id=" + message.id); Log.i(Helper.TAG, "Deleting existing uid=" + old);
iprev.setFlag(Flags.Flag.DELETED, true); iprev.setFlag(Flags.Flag.DELETED, true);
ifolder.expunge(); ifolder.expunge();
} }
} }
db.message().setMessageUid(message.id, uid[0].uid);
Log.i(Helper.TAG, "Appended uid=" + message.uid);
} }
private void doMove(EntityFolder folder, Session isession, IMAPStore istore, IMAPFolder ifolder, EntityMessage message, JSONArray jargs, DB db) throws JSONException, MessagingException, IOException { private void doMove(EntityFolder folder, Session isession, IMAPStore istore, IMAPFolder ifolder, EntityMessage message, JSONArray jargs, DB db) throws JSONException, MessagingException, IOException {