From 3edad14a5f049bf4391d48780964b618347dea0c Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 12 Apr 2020 15:30:33 +0200 Subject: [PATCH] Allow moving POP3 drafts --- app/src/main/java/eu/faircode/email/Core.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 9f1f3840aa..200984a358 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -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;