Allow moving POP3 drafts

This commit is contained in:
M66B 2020-04-12 15:30:33 +02:00
parent 4aeeda6d59
commit 3edad14a5f
1 changed files with 6 additions and 4 deletions

View File

@ -956,15 +956,17 @@ class Core {
boolean seen = jargs.optBoolean(1);
boolean unflag = jargs.optBoolean(3);
// Move from trash only
if (!EntityFolder.TRASH.equals(folder.type))
throw new IllegalArgumentException("Invalid POP3 folder type=" + folder.type);
// Get target folder
EntityFolder target = db.folder().getFolder(id);
if (target == null)
throw new FolderNotFoundException();
// Move from trash/drafts only
if (!EntityFolder.TRASH.equals(folder.type) &&
!EntityFolder.DRAFTS.equals(folder.type))
throw new IllegalArgumentException("Invalid POP3 folder" +
" source=" + folder.type + " target=" + target.type);
message.folder = target.id;
if (seen)
message.ui_seen = seen;