]> granicus.if.org Git - neomutt/commitdiff
Handle reopen/new_mail when closing mailbox in <imap-logout-all>
authorKevin McCarthy <kevin@8t8.us>
Wed, 25 Jul 2018 01:12:20 +0000 (18:12 -0700)
committerRichard Russon <rich@flatcap.org>
Sat, 1 Sep 2018 17:06:08 +0000 (18:06 +0100)
Other callers, such as OP_QUIT, OP_MAIN_CHANGE_FOLDER, and
OP_MAIN_SYNC_FOLDER handle the case where a sync or close_mailbox
fails due to new mail or a reopen.

OP_MAIN_LOGOUT_ALL appears to have been accidentally missed.  Add a
call to update_index() to properly sort and update vcounts.

curs_main.c

index 3ba1e963548acdeb060a8ac3260d5b75a8d1761a..90edd44d184580258bf1d7434de564bed1210f0c 100644 (file)
@@ -1783,8 +1783,11 @@ int mutt_index_menu(void)
       case OP_MAIN_IMAP_LOGOUT_ALL:
         if (Context && Context->magic == MUTT_IMAP)
         {
-          if (mx_mbox_close(&Context, &index_hint) != 0)
+          int check = mx_mbox_close(&Context, &index_hint);
+          if (check != 0)
           {
+            if ((check == MUTT_NEW_MAIL) || (check == MUTT_REOPENED))
+              update_index(menu, Context, check, oldcount, index_hint);
             OptSearchInvalid = true;
             menu->redraw = REDRAW_FULL;
             break;