]> granicus.if.org Git - neomutt/commitdiff
Fix unsub from the selected mailbox by just hiding it
authorPietro Cerutti <gahr@gahr.ch>
Thu, 29 Nov 2018 09:30:30 +0000 (09:30 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 29 Nov 2018 13:18:32 +0000 (13:18 +0000)
Fixes #1460

mailbox.c

index 8c6c8c63ea760b24819a261ceaae674a1300d476..b635f155334850a0181d0067deb3914ad4c399ba 100644 (file)
--- a/mailbox.c
+++ b/mailbox.c
@@ -525,9 +525,16 @@ int mutt_parse_unmailboxes(struct Buffer *buf, struct Buffer *s,
 #ifdef USE_INOTIFY
         mutt_monitor_remove(np->m);
 #endif
-        mx_ac_remove(np->m);
+        if (Context->mailbox == np->m)
+        {
+          np->m->flags |= MB_HIDDEN;
+        }
+        else
+        {
+          mx_ac_remove(np->m);
+          mailbox_free(&np->m);
+        }
         STAILQ_REMOVE(&AllMailboxes, np, MailboxNode, entries);
-        mailbox_free(&np->m);
         FREE(&np);
         continue;
       }