]> granicus.if.org Git - neomutt/commitdiff
Call mx_update_context from mx_mbox_check, if needed 1472/head
authorPietro Cerutti <gahr@gahr.ch>
Mon, 3 Dec 2018 15:26:02 +0000 (15:26 +0000)
committerRichard Russon <rich@flatcap.org>
Tue, 4 Dec 2018 13:34:49 +0000 (13:34 +0000)
mx.c

diff --git a/mx.c b/mx.c
index e9e649da6c73913db28fbe40cafc4c71ecdb09d3..efd2e425de438cb9c7040078c423012588de17a4 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1120,8 +1120,13 @@ int mx_mbox_check(struct Context *ctx, int *index_hint)
     return -1;
 
   struct Mailbox *m = ctx->mailbox;
+  int rc = m->mx_ops->mbox_check(ctx, index_hint);
+  if (rc == MUTT_NEW_MAIL || rc == MUTT_REOPENED)
+  {
+    mx_update_context(ctx);
+  }
 
-  return m->mx_ops->mbox_check(ctx, index_hint);
+  return rc;
 }
 
 /**