]> granicus.if.org Git - mutt/commitdiff
Use context to get IMAP new message count in mailbox browser if possible.
authorBrendan Cully <brendan@kublai.com>
Sat, 17 May 2008 19:02:24 +0000 (12:02 -0700)
committerBrendan Cully <brendan@kublai.com>
Sat, 17 May 2008 19:02:24 +0000 (12:02 -0700)
imap/browse.c

index 4654c48ed35c42d2744a3dda28894f07be962420..750a65dacc1ba0f7f7fd1bbdcb03302541b1f575 100644 (file)
@@ -228,7 +228,12 @@ int imap_mailbox_state (const char* path, struct mailbox_state* state)
     return -1;
   }
 
-  if ((status = imap_mboxcache_get (idata, mx.mbox, 0)))
+  if (!imap_mxcmp(mx.mbox, idata->mailbox))
+  {
+    state->new = idata->ctx->new;
+    state->messages = idata->ctx->msgcount;
+  }
+  else if ((status = imap_mboxcache_get (idata, mx.mbox, 0)))
   {
     state->new = status->unseen;
     state->messages = status->messages;