summaryrefslogtreecommitdiffstats
path: root/curs_main.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2018-07-24 18:12:20 -0700
committerKevin McCarthy <kevin@8t8.us>2018-07-24 18:12:20 -0700
commit1147aed6ac9b34bdcd1f464493bbbd06a47fce5e (patch)
tree45afdbeeb6b502f5b3c921149eca4d24a87ad281 /curs_main.c
parent2030998edda4b820a2cd820e36ca1d99b675001d (diff)
Handle reopen/new_mail when closing mailbox in <imap-logout-all>.
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.
Diffstat (limited to 'curs_main.c')
-rw-r--r--curs_main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/curs_main.c b/curs_main.c
index 1b211961..99338671 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -1159,8 +1159,12 @@ int mutt_index_menu (void)
case OP_MAIN_IMAP_LOGOUT_ALL:
if (Context && Context->magic == MUTT_IMAP)
{
- if (mx_close_mailbox (Context, &index_hint) != 0)
+ int check;
+
+ if ((check = mx_close_mailbox (Context, &index_hint)) != 0)
{
+ if (check == MUTT_NEW_MAIL || check == MUTT_REOPENED)
+ update_index (menu, Context, check, oldcount, index_hint);
set_option (OPTSEARCHINVALID);
menu->redraw = REDRAW_FULL;
break;