MailboxNotify++;
}
-/**
- * mailbox_get - Fetch mailbox object for given path, if present
- * @param path Path to the mailbox
- * @retval ptr Mailbox for the path
- */
-static struct Mailbox *mailbox_get(const char *path)
-{
- if (!path)
- return NULL;
-
- char *epath = mutt_str_strdup(path);
- if (!epath)
- return NULL;
-
- mutt_expand_path(epath, mutt_str_strlen(epath));
-
- struct MailboxNode *np = NULL;
- STAILQ_FOREACH(np, &AllMailboxes, entries)
- {
- /* must be done late because e.g. IMAP delimiter may change */
- mutt_expand_path(np->m->path, sizeof(np->m->path));
- if (mutt_str_strcmp(np->m->path, path) == 0)
- {
- FREE(&epath);
- return np->m;
- }
- }
-
- FREE(&epath);
- return NULL;
-}
-
/**
* mutt_mailbox_cleanup - Restore the timestamp of a mailbox
* @param path Path to the mailbox
/**
* mutt_mailbox_setnotified - Note when the user was last notified of new mail
- * @param path Path to the mailbox
+ * @param m Mailbox
*/
-void mutt_mailbox_setnotified(const char *path)
+void mutt_mailbox_setnotified(struct Mailbox *m)
{
- struct Mailbox *m = mailbox_get(path);
if (!m)
return;
void mutt_mailbox_cleanup(const char *path, struct stat *st);
/** mark mailbox just left as already notified */
-void mutt_mailbox_setnotified(const char *path);
+void mutt_mailbox_setnotified(struct Mailbox *m);
/* force flags passed to mutt_mailbox_check() */
#define MUTT_MAILBOX_CHECK_FORCE (1 << 0)
/* 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 (!ctx->peekonly)
- mutt_mailbox_setnotified(ctx->mailbox->path);
+ mutt_mailbox_setnotified(ctx->mailbox);
if (ctx->mailbox->mx_ops)
ctx->mailbox->mx_ops->mbox_close(ctx);