struct Email *last_tag; /**< last tagged msg. used to link threads */
struct MuttThread *tree; /**< top of thread tree */
struct Hash *thread_hash; /**< hash table for threading */
- int tagged; /**< how many messages are tagged? */
int msgnotreadyet; /**< which msg "new" in pager, -1 if none */
struct Menu *menu; /**< needed for pattern compilation */
bool changed = e->changed;
int deleted = m->msg_deleted;
- int tagged = ctx->tagged;
+ int tagged = m->msg_tagged;
int flagged = m->msg_flagged;
int update = false;
update = true;
e->tagged = true;
if (upd_ctx)
- ctx->tagged++;
+ m->msg_tagged++;
}
}
else if (e->tagged)
update = true;
e->tagged = false;
if (upd_ctx)
- ctx->tagged--;
+ m->msg_tagged--;
}
break;
}
* of this message and not what it was at the time it was last searched.
*/
if (e->searched && (changed != e->changed || deleted != m->msg_deleted ||
- tagged != ctx->tagged || flagged != m->msg_flagged))
+ tagged != m->msg_tagged || flagged != m->msg_flagged))
{
e->searched = false;
}
continue;
}
- if (!Context)
+ if (!Context || !Context->mailbox)
{
mutt_error(_("No mailbox is open"));
continue;
}
- if (!Context->tagged)
+ if (!Context->mailbox->msg_tagged)
{
if (op == OP_TAG_PREFIX)
mutt_error(_("No tagged messages"));
tag = true;
continue;
}
- else if (AutoTag && Context && Context->tagged)
+ else if (AutoTag && Context && Context->mailbox && Context->mailbox->msg_tagged)
tag = true;
mutt_clear_error();
{
char msgbuf[STRING];
snprintf(msgbuf, sizeof(msgbuf), _("Update tags..."));
- mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, 1, Context->tagged);
+ mutt_progress_init(&progress, msgbuf, MUTT_PROGRESS_MSG, 1, Context->mailbox->msg_tagged);
}
#ifdef USE_NOTMUCH
int msg_flagged; /**< number of flagged messages */
int msg_new; /**< number of new messages */
int msg_deleted; /**< number of deleted messages */
+ int msg_tagged; /**< how many messages are tagged? */
struct Email **hdrs;
int hdrmax; /**< number of pointers in hdrs */
m->msg_count = 0;
m->vcount = 0;
ctx->vsize = 0;
- ctx->tagged = 0;
+ m->msg_tagged = 0;
m->msg_deleted = 0;
m->msg_new = 0;
m->msg_unread = 0;
/* update memory to reflect the new state of the mailbox */
m->vcount = 0;
ctx->vsize = 0;
- ctx->tagged = 0;
+ m->msg_tagged = 0;
m->msg_deleted = 0;
m->msg_new = 0;
m->msg_unread = 0;
}
if (m->hdrs[j]->tagged)
- ctx->tagged++;
+ m->msg_tagged++;
if (m->hdrs[j]->flagged)
m->msg_flagged++;
if (!m->hdrs[j]->read)
for (int i = 0; i < m->msg_count; i++)
mutt_email_free(&m->hdrs[i]);
m->msg_count = 0;
- ctx->tagged = 0;
+ m->msg_tagged = 0;
if (mdata->last_message < mdata->last_loaded)
{
static void make_reference_headers(struct Envelope *curenv,
struct Envelope *env, struct Context *ctx)
{
- if (!env || !ctx)
+ if (!env || !ctx || !ctx->mailbox)
return;
if (!curenv)
/* if there's more than entry in In-Reply-To (i.e. message has
multiple parents), don't generate a References: header as it's
discouraged by RFC2822, sect. 3.6.4 */
- if (ctx->tagged > 0 && !STAILQ_EMPTY(&env->in_reply_to) &&
+ if (ctx->mailbox->msg_tagged > 0 && !STAILQ_EMPTY(&env->in_reply_to) &&
STAILQ_NEXT(STAILQ_FIRST(&env->in_reply_to), entries))
{
mutt_list_free(&env->references);
{
if (cur && ctx)
mutt_set_flag(ctx, cur, MUTT_REPLIED, is_reply(cur, msg));
- else if (!(flags & SEND_POSTPONED) && ctx && ctx->tagged)
+ else if (!(flags & SEND_POSTPONED) && ctx && ctx->mailbox &&
+ ctx->mailbox->msg_tagged)
{
for (i = 0; i < ctx->mailbox->msg_count; i++)
{
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, c ? Context->tagged : 0);
+ snprintf(buf, buflen, fmt, c ? Context->mailbox->msg_tagged : 0);
}
- else if ((c && Context->tagged == 0) || !c)
+ else if ((c && Context->mailbox->msg_tagged == 0) || !c)
optional = 0;
break;
if (!optional)
{
snprintf(fmt, sizeof(fmt), "%%%sd", prec);
- snprintf(buf, buflen, fmt, Context ? Context->tagged : 0);
+ snprintf(buf, buflen, fmt, Context ? Context->mailbox->msg_tagged : 0);
}
- else if (!Context || !Context->tagged)
+ else if (!Context || !Context->mailbox || !Context->mailbox->msg_tagged)
optional = 0;
break;