]> granicus.if.org Git - neomutt/commitdiff
Fix use of confirmcreate with IMAP. A patch for this was suggested
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 18 Jan 2000 22:23:53 +0000 (22:23 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 18 Jan 2000 22:23:53 +0000 (22:23 +0000)
by Brian R. Gaeke.

imap/imap.c
imap/message.c

index 6830fbee32e06815169dd18354731100d87dd288..ead41b153450999457f916e497b60c0d1880c5aa 100644 (file)
@@ -801,18 +801,12 @@ int imap_open_mailbox_append (CONTEXT *ctx)
   if (r == -2)
   {
     /* command failed cause folder doesn't exist */
-    if (option (OPTCONFIRMCREATE))
-    {
-      snprintf (buf, sizeof (buf), _("Create %s?"), mailbox);
-      if (mutt_yesorno (buf, 1) < 1)
-      {
-       return (-1);
-      }
-      if (imap_create_mailbox (ctx, mailbox) < 0)
-      {
-       return (-1);
-      }
-    }
+    snprintf (buf, sizeof (buf), _("Create %s?"), mailbox);
+    if (option (OPTCONFIRMCREATE) && mutt_yesorno (buf, 1) < 1)
+      return (-1);
+
+    if (imap_create_mailbox (ctx, mailbox) < 0)
+      return (-1);
   }
   else if (r == -1)
   {
index f959187b403ffcb061e4ce9b4fc04ab0730bb339..d5c894c1f9c5875e1bbe1bad61dc44d3e4e0e98b 100644 (file)
@@ -569,17 +569,15 @@ int imap_copy_messages (CONTEXT* ctx, HEADER* h, char* dest, int delete)
       return -1;
     }
     dprint (2, (debugfile, "imap_copy_messages: server suggests TRYCREATE\n"));
-    if (option (OPTCONFIRMCREATE))
+    snprintf (buf, sizeof (buf), _("Create %s?"), mbox);
+    if (option (OPTCONFIRMCREATE) && mutt_yesorno (buf, 1) < 1)
     {
-      snprintf (buf, sizeof (buf), _("Create %s?"), mbox);
-      if (mutt_yesorno (buf, 1) < 1)
-      {
-        mutt_clear_error ();
-       return -1;
-      }
-      if (imap_create_mailbox (ctx, mbox) < 0)
-       return -1;
+      mutt_clear_error ();
+      return -1;
     }
+    if (imap_create_mailbox (ctx, mbox) < 0)
+      return -1;
+
     /* try again */
     rc = imap_exec (buf, sizeof (buf), CTX_DATA, cmd, 0);
   }