struct Hash *label_hash; /**< hash table for x-labels */
struct Account *account;
+ int opened; /**< number of times mailbox is opened */
int flags; /**< e.g. #MB_NORMAL */
if (!m->mx_ops || !m->mx_ops->mbox_open_append)
return -1;
- return m->mx_ops->mbox_open_append(m, flags);
+ int rc = m->mx_ops->mbox_open_append(m, flags);
+ m->opened++;
+ return rc;
}
/**
mutt_message(_("Reading %s..."), m->path);
int rc = m->mx_ops->mbox_open(ctx);
+ m->opened++;
if ((rc == 0) || (rc == -2))
{
struct Mailbox *m = ctx->mailbox;
+ m->opened--;
+ if (m->opened != 0)
+ return;
+
/* never announce that a mailbox we've just left has new mail. #3290
* TODO: really belongs in mx_mbox_close, but this is a nice hook point */
if (!m->peekonly)