Set draft flags for drafts

This commit is contained in:
M66B 2018-11-25 14:28:04 +01:00
parent a9d93929af
commit fecb77be8d
1 changed files with 6 additions and 1 deletions

View File

@ -1492,9 +1492,14 @@ public class ServiceSynchronize extends LifecycleService {
private void doAdd(EntityFolder folder, Session isession, IMAPFolder ifolder, EntityMessage message, JSONArray jargs, DB db) throws MessagingException, JSONException, IOException {
// Append message
MimeMessage imessage = MessageHelper.from(this, message, isession);
if (EntityFolder.DRAFTS.equals(folder.type) && ifolder.getPermanentFlags().contains(Flags.Flag.DRAFT))
imessage.setFlag(Flags.Flag.DRAFT, true);
AppendUID[] uid = ifolder.appendUIDMessages(new Message[]{imessage});
Log.i(Helper.TAG, "Appended uid=" + uid[0].uid + " draft=" + imessage.getFlags().contains(Flags.Flag.DRAFT));
db.message().setMessageUid(message.id, uid[0].uid);
Log.i(Helper.TAG, "Appended uid=" + uid[0].uid);
if (message.uid != null) {
Message iprev = ifolder.getMessageByUID(message.uid);