]> granicus.if.org Git - neomutt/commitdiff
Fix sidebar buffy stats updating on mailbox close.
authorKevin McCarthy <kevin@8t8.us>
Mon, 6 Jun 2016 01:05:41 +0000 (18:05 -0700)
committerKevin McCarthy <kevin@8t8.us>
Mon, 6 Jun 2016 01:05:41 +0000 (18:05 -0700)
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.

mx.c

diff --git a/mx.c b/mx.c
index 317bcfd4791436a302e6fb39820992d2218e63ce..e05142164ebdaa2a62a73c0c6aaf251a5c8e6a29 100644 (file)
--- 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;