mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 02:37:16 +00:00
Set draft flags for drafts
This commit is contained in:
parent
a9d93929af
commit
fecb77be8d
1 changed files with 6 additions and 1 deletions
|
@ -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 {
|
private void doAdd(EntityFolder folder, Session isession, IMAPFolder ifolder, EntityMessage message, JSONArray jargs, DB db) throws MessagingException, JSONException, IOException {
|
||||||
// Append message
|
// Append message
|
||||||
MimeMessage imessage = MessageHelper.from(this, message, isession);
|
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});
|
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);
|
db.message().setMessageUid(message.id, uid[0].uid);
|
||||||
Log.i(Helper.TAG, "Appended uid=" + uid[0].uid);
|
|
||||||
|
|
||||||
if (message.uid != null) {
|
if (message.uid != null) {
|
||||||
Message iprev = ifolder.getMessageByUID(message.uid);
|
Message iprev = ifolder.getMessageByUID(message.uid);
|
||||||
|
|
Loading…
Reference in a new issue