diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-12-07 21:13:43 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-12-07 21:13:43 +0000 |
commit | 79f33c0fd827e8df431f0fcbf2c9c86e1807cc19 (patch) | |
tree | 39bf2758862c9b6455fc801754c368576da1449c /mx.c | |
parent | 1e4795f0996b84f87b1a2b145c1ee0d3a3db3224 (diff) |
Fix a couple of flag-related bugs in the maildir folder update code.
Diffstat (limited to 'mx.c')
-rw-r--r-- | mx.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -838,7 +838,7 @@ int mx_close_mailbox (CONTEXT *ctx) /* update a Context structure's internal tables. */ -void mx_update_tables(CONTEXT *ctx, int do_delete) +void mx_update_tables(CONTEXT *ctx, int committing) { int i, j; @@ -854,8 +854,8 @@ void mx_update_tables(CONTEXT *ctx, int do_delete) #define this_body ctx->hdrs[j]->content for (i = 0, j = 0; i < ctx->msgcount; i++) { - if ((do_delete && !ctx->hdrs[i]->deleted) || - (!do_delete && ctx->hdrs[i]->active)) + if ((committing && !ctx->hdrs[i]->deleted) || + (!committing && ctx->hdrs[i]->active)) { if (i != j) { @@ -870,7 +870,17 @@ void mx_update_tables(CONTEXT *ctx, int do_delete) ctx->vsize += this_body->length + this_body->offset - this_body->hdr_offset; } - ctx->hdrs[j]->changed = 0; + + if(committing) + ctx->hdrs[j]->changed = 0; + else + { + if (ctx->hdrs[j]->deleted) + ctx->deleted++; + if (ctx->hdrs[j]->changed) + ctx->changed++; + } + if (ctx->hdrs[j]->tagged) ctx->tagged++; if (ctx->hdrs[j]->flagged) @@ -881,6 +891,7 @@ void mx_update_tables(CONTEXT *ctx, int do_delete) if (!ctx->hdrs[j]->old) ctx->new++; } + j++; } else |