From: Kevin McCarthy Date: Mon, 6 Jun 2016 01:05:41 +0000 (-0700) Subject: Fix sidebar buffy stats updating on mailbox close. X-Git-Tag: neomutt-20160822~130 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e40ce6b966e7b2cc871ee0b9a84fe6348fcd797;p=neomutt Fix sidebar buffy stats updating on mailbox close. Move the mutt_sb_set_buffystats() call from mx_fastclose_mailbox() to the bottom of mx_close_mailbox(). Append-only mailboxes don't have msgcount set, so fastclose was the wrong place to be doing these updates. --- diff --git a/mx.c b/mx.c index 317bcfd47..e05142164 100644 --- a/mx.c +++ b/mx.c @@ -743,10 +743,6 @@ void mx_fastclose_mailbox (CONTEXT *ctx) mutt_clear_threads (ctx); for (i = 0; i < ctx->msgcount; i++) mutt_free_header (&ctx->hdrs[i]); -#ifdef USE_SIDEBAR - ctx->msgcount -= ctx->deleted; - mutt_sb_set_buffystats (ctx); -#endif FREE (&ctx->hdrs); FREE (&ctx->v2r); FREE (&ctx->path); @@ -1015,6 +1011,11 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) !mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY)) mx_unlink_empty (ctx->path); +#ifdef USE_SIDEBAR + ctx->msgcount -= ctx->deleted; + mutt_sb_set_buffystats (ctx); +#endif + mx_fastclose_mailbox (ctx); return 0;