|
|
@ -763,6 +763,9 @@ class Core {
|
|
|
|
|
|
|
|
|
|
|
|
// Get arguments
|
|
|
|
// Get arguments
|
|
|
|
long id = jargs.getLong(0);
|
|
|
|
long id = jargs.getLong(0);
|
|
|
|
|
|
|
|
boolean seen = jargs.optBoolean(1);
|
|
|
|
|
|
|
|
boolean unflag = jargs.optBoolean(3);
|
|
|
|
|
|
|
|
|
|
|
|
Flags flags = ifolder.getPermanentFlags();
|
|
|
|
Flags flags = ifolder.getPermanentFlags();
|
|
|
|
|
|
|
|
|
|
|
|
// Get target folder
|
|
|
|
// Get target folder
|
|
|
@ -813,19 +816,15 @@ class Core {
|
|
|
|
itarget.appendMessages(icopies.toArray(new Message[0]));
|
|
|
|
itarget.appendMessages(icopies.toArray(new Message[0]));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
for (Message imessage : map.keySet()) {
|
|
|
|
for (Message imessage : map.keySet()) {
|
|
|
|
EntityMessage message = map.get(imessage);
|
|
|
|
Log.i("Move seen=" + seen + " unflag=" + unflag);
|
|
|
|
|
|
|
|
|
|
|
|
// Auto read
|
|
|
|
// Mark read
|
|
|
|
if (flags.contains(Flags.Flag.SEEN))
|
|
|
|
if (seen && flags.contains(Flags.Flag.SEEN))
|
|
|
|
imessage.setFlag(Flags.Flag.SEEN, message.ui_seen);
|
|
|
|
imessage.setFlag(Flags.Flag.SEEN, true);
|
|
|
|
|
|
|
|
|
|
|
|
// Auto unflag
|
|
|
|
// Remove star
|
|
|
|
if (flags.contains(Flags.Flag.FLAGGED))
|
|
|
|
if (unflag && flags.contains(Flags.Flag.FLAGGED))
|
|
|
|
imessage.setFlag(Flags.Flag.FLAGGED, message.ui_flagged);
|
|
|
|
imessage.setFlag(Flags.Flag.FLAGGED, false);
|
|
|
|
|
|
|
|
|
|
|
|
// Answered fix
|
|
|
|
|
|
|
|
if (flags.contains(Flags.Flag.ANSWERED))
|
|
|
|
|
|
|
|
imessage.setFlag(Flags.Flag.ANSWERED, message.ui_answered);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ifolder.copyMessages(map.keySet().toArray(new Message[0]), itarget);
|
|
|
|
ifolder.copyMessages(map.keySet().toArray(new Message[0]), itarget);
|
|
|
@ -854,17 +853,13 @@ class Core {
|
|
|
|
if (draft) {
|
|
|
|
if (draft) {
|
|
|
|
Message icopy = itarget.getMessageByUID(uid);
|
|
|
|
Message icopy = itarget.getMessageByUID(uid);
|
|
|
|
|
|
|
|
|
|
|
|
// Auto read
|
|
|
|
// Mark read
|
|
|
|
if (flags.contains(Flags.Flag.SEEN))
|
|
|
|
if (seen && flags.contains(Flags.Flag.SEEN))
|
|
|
|
icopy.setFlag(Flags.Flag.SEEN, message.ui_seen);
|
|
|
|
icopy.setFlag(Flags.Flag.SEEN, true);
|
|
|
|
|
|
|
|
|
|
|
|
// Auto unflag
|
|
|
|
|
|
|
|
if (flags.contains(Flags.Flag.FLAGGED))
|
|
|
|
|
|
|
|
icopy.setFlag(Flags.Flag.FLAGGED, message.ui_flagged);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Answered fix
|
|
|
|
// Remove star
|
|
|
|
if (flags.contains(Flags.Flag.ANSWERED))
|
|
|
|
if (unflag && flags.contains(Flags.Flag.FLAGGED))
|
|
|
|
icopy.setFlag(Flags.Flag.ANSWERED, message.ui_answered);
|
|
|
|
icopy.setFlag(Flags.Flag.FLAGGED, false);
|
|
|
|
|
|
|
|
|
|
|
|
// Set drafts flag
|
|
|
|
// Set drafts flag
|
|
|
|
icopy.setFlag(Flags.Flag.DRAFT, EntityFolder.DRAFTS.equals(target.type));
|
|
|
|
icopy.setFlag(Flags.Flag.DRAFT, EntityFolder.DRAFTS.equals(target.type));
|
|
|
|