/**
* mutt_set_flag_update - Set a flag on an email
- * @param m Mailbox
- * @param e Email
- * @param flag Flag to set, e.g. #MUTT_DELETE
- * @param bf true: set the flag; false: clear the flag
- * @param upd_ctx true: update the Context
+ * @param m Mailbox
+ * @param e Email
+ * @param flag Flag to set, e.g. #MUTT_DELETE
+ * @param bf true: set the flag; false: clear the flag
+ * @param upd_mbox true: update the Context
*/
-void mutt_set_flag_update(struct Mailbox *m, struct Email *e, int flag, bool bf, bool upd_ctx)
+void mutt_set_flag_update(struct Mailbox *m, struct Email *e, int flag, bool bf, bool upd_mbox)
{
if (!m || !e)
return;
{
e->deleted = true;
update = true;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_deleted++;
#ifdef USE_IMAP
/* deleted messages aren't treated as changed elsewhere so that the
if (m->magic == MUTT_IMAP)
{
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
#endif
{
e->deleted = false;
update = true;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_deleted--;
#ifdef USE_IMAP
/* see my comment above */
if (m->magic == MUTT_IMAP)
{
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
#endif
* is checked in specific code in the maildir folder
* driver.
*/
- if (m->magic == MUTT_MAILDIR && upd_ctx && e->trash)
+ if (m->magic == MUTT_MAILDIR && upd_mbox && e->trash)
m->changed = true;
}
break;
{
update = true;
e->old = false;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_new++;
if (e->read)
{
e->read = false;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_unread++;
}
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
}
{
update = true;
if (!e->old)
- if (upd_ctx)
+ if (upd_mbox)
m->msg_new--;
e->read = true;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_unread--;
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
break;
update = true;
e->old = true;
if (!e->read)
- if (upd_ctx)
+ if (upd_mbox)
m->msg_new--;
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
}
update = true;
e->old = false;
if (!e->read)
- if (upd_ctx)
+ if (upd_mbox)
m->msg_new++;
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
break;
{
update = true;
e->read = true;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_unread--;
if (!e->old)
- if (upd_ctx)
+ if (upd_mbox)
m->msg_new--;
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
}
{
update = true;
e->read = false;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_unread++;
if (!e->old)
- if (upd_ctx)
+ if (upd_mbox)
m->msg_new++;
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
break;
if (!e->read)
{
e->read = true;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_unread--;
if (!e->old)
- if (upd_ctx)
+ if (upd_mbox)
m->msg_new--;
}
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
}
update = true;
e->replied = false;
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
break;
{
update = true;
e->flagged = bf;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_flagged++;
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
}
{
update = true;
e->flagged = false;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_flagged--;
e->changed = true;
- if (upd_ctx)
+ if (upd_mbox)
m->changed = true;
}
break;
{
update = true;
e->tagged = true;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_tagged++;
}
}
{
update = true;
e->tagged = false;
- if (upd_ctx)
+ if (upd_mbox)
m->msg_tagged--;
}
break;
int mutt_set_xdg_path(enum XdgType type, char *buf, size_t bufsize);
void mutt_help(int menu);
void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op);
-void mutt_set_flag_update(struct Mailbox *m, struct Email *e, int flag, bool bf, bool upd_ctx);
+void mutt_set_flag_update(struct Mailbox *m, struct Email *e, int flag, bool bf, bool upd_mbox);
#define mutt_set_flag(a, b, c, d) mutt_set_flag_update(a, b, c, d, true)
void mutt_signal_init(void);
void mutt_tag_set_flag(int flag, int bf);