From: Kevin McCarthy Date: Wed, 25 Jul 2018 01:12:20 +0000 (-0700) Subject: Handle reopen/new_mail when closing mailbox in X-Git-Tag: 2019-10-25~671^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ddae452ed8dc01ad3eea5fee8f254b60aee5983;p=neomutt Handle reopen/new_mail when closing mailbox in 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. --- diff --git a/curs_main.c b/curs_main.c index 3ba1e9635..90edd44d1 100644 --- a/curs_main.c +++ b/curs_main.c @@ -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;