diff options
author | Kevin McCarthy <kevin@8t8.us> | 2015-07-21 12:41:13 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2015-07-21 12:41:13 -0700 |
commit | ecbd6cec667ca17e0f5e8a03177109f70a578aae (patch) | |
tree | 7ec40ed93305a87161b65c86d2288ad0a4af6e83 /imap/imap.c | |
parent | 1cd2af3b95fadeb6501ffeb68aa8df89e8901175 (diff) | |
parent | fe6d893cda486712f803813d8ba80941a2205a3f (diff) |
merge stable
Diffstat (limited to 'imap/imap.c')
-rw-r--r-- | imap/imap.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/imap/imap.c b/imap/imap.c index 8c89ae2c..ad15f5e1 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1280,8 +1280,18 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int* index_hint) goto out; } + /* Update local record of server state to reflect the synchronization just + * completed. imap_read_headers always overwrites hcache-origin flags, so + * there is no need to mutate the hcache after flag-only changes. */ for (n = 0; n < ctx->msgcount; n++) + { + HEADER_DATA(ctx->hdrs[n])->deleted = ctx->hdrs[n]->deleted; + HEADER_DATA(ctx->hdrs[n])->flagged = ctx->hdrs[n]->flagged; + HEADER_DATA(ctx->hdrs[n])->old = ctx->hdrs[n]->old; + HEADER_DATA(ctx->hdrs[n])->read = ctx->hdrs[n]->read; + HEADER_DATA(ctx->hdrs[n])->replied = ctx->hdrs[n]->replied; ctx->hdrs[n]->changed = 0; + } ctx->changed = 0; /* We must send an EXPUNGE command if we're not closing. */ |