diff options
author | Kevin McCarthy <kevin@8t8.us> | 2022-12-07 15:51:36 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2022-12-12 14:44:23 -0800 |
commit | ef2abed29fe02d3a38768ca62b2c8c485074bad3 (patch) | |
tree | 8b07e147042b5224ce8f54275bd4a20003347ce2 | |
parent | d0faf2d44455bca84be71d769de0d085124a44db (diff) |
Fix counters for external maildir 'T' flag changes.
The maildir_check_mailbox() code was not updating the context deleted
and trashed counts in those cases. This could lead to messages marked
as deleted, but no action being taken on a mailbox sync/close.
wip: fix ctx counts for maildir 'T' flags updates.
-rw-r--r-- | mh.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -2334,9 +2334,20 @@ static int maildir_check_mailbox (CONTEXT * ctx, int *index_hint) if (ctx->hdrs[i]->deleted != p->h->deleted) { ctx->hdrs[i]->deleted = p->h->deleted; + if (ctx->hdrs[i]->deleted) + ctx->deleted++; + else + ctx->deleted--; flags_changed = 1; } - ctx->hdrs[i]->trash = p->h->trash; + if (ctx->hdrs[i]->trash != p->h->trash) + { + ctx->hdrs[i]->trash = p->h->trash; + if (ctx->hdrs[i]->trash) + ctx->trashed++; + else + ctx->trashed--; + } /* this is a duplicate of an existing header, so remove it */ mutt_free_header (&p->h); |