void maildir_parse_flags(struct Email *e, const char *path);
struct Email *maildir_parse_message(enum MailboxType magic, const char *fname, bool is_old, struct Email *e);
struct Email *maildir_parse_stream(enum MailboxType magic, FILE *f, const char *fname, bool is_old, struct Email *e);
-bool maildir_update_flags(struct Context *ctx, struct Email *o, struct Email *n);
+bool maildir_update_flags(struct Mailbox *m, struct Email *o, struct Email *n);
bool mh_mailbox(struct Mailbox *m, bool check_stats);
int mh_check_empty(const char *path);
/**
* maildir_update_flags - Update the mailbox flags
- * @param ctx Mailbox
+ * @param m Mailbox
* @param o Old email Header
* @param n New email Header
* @retval true If the flags changed
* @retval false Otherwise
*/
-bool maildir_update_flags(struct Context *ctx, struct Email *o, struct Email *n)
+bool maildir_update_flags(struct Mailbox *m, struct Email *o, struct Email *n)
{
- if (!ctx || !ctx->mailbox)
+ if (!m)
return -1;
- struct Mailbox *m = ctx->mailbox;
-
/* save the global state here so we can reset it at the
* end of list block if required.
*/
* the flags we just detected.
*/
if (!m->hdrs[i]->changed)
- if (maildir_update_flags(ctx, m->hdrs[i], p->email))
+ if (maildir_update_flags(ctx->mailbox, m->hdrs[i], p->email))
flags_changed = true;
if (m->hdrs[i]->deleted == m->hdrs[i]->trash)
m->hdrs[i]->active = true;
/* found the right message */
if (!m->hdrs[i]->changed)
- if (maildir_update_flags(ctx, m->hdrs[i], p->email))
+ if (maildir_update_flags(ctx->mailbox, m->hdrs[i], p->email))
flags_changed = true;
mutt_email_free(&p->email);
*/
struct Email tmp = { 0 };
maildir_parse_flags(&tmp, new);
- maildir_update_flags(ctx, e, &tmp);
+ maildir_update_flags(ctx->mailbox, e, &tmp);
}
if (update_email_tags(e, msg) == 0)