Commit 0bcb77a6 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Fix uses of context->changed as a counter.

The first was in mx_update_tables(), but only when "not committing".
This is used by mh/maildir during an "occult" update, and in imap when
expunging the mailbox.  It meant to simply turn on changed when a
single changed header is seen.

The second use was in imap_sync_message_for_copy().  Previously this
was used for a server side copy/save, but is now also used for
fast-trash copying.  Remove the code that was trying to decrement the
counter: this function is not capable of properly setting a status
bit.
parent b333df6d
......@@ -1102,10 +1102,7 @@ int imap_sync_message_for_copy (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd,
if (!compare_flags_for_copy (hdr))
{
if (hdr->deleted == HEADER_DATA(hdr)->deleted)
{
hdr->changed = 0;
idata->ctx->changed--;
}
return 0;
}
......@@ -1172,10 +1169,7 @@ int imap_sync_message_for_copy (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd,
hdr->active = 1;
if (hdr->deleted == HEADER_DATA(hdr)->deleted)
{
hdr->changed = 0;
idata->ctx->changed--;
}
return 0;
}
......
......@@ -1054,7 +1054,7 @@ void mx_update_tables(CONTEXT *ctx, int committing)
if (committing)
ctx->hdrs[j]->changed = 0;
else if (ctx->hdrs[j]->changed)
ctx->changed++;
ctx->changed = 1;
if (!committing || (ctx->magic == MUTT_MAILDIR && option (OPTMAILDIRTRASH)))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment