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