From: Timo Sirainen Date: Sun, 12 Aug 2012 04:21:00 +0000 (+0300) Subject: lib-storage: Update private index before updating saved search results. X-Git-Tag: 2.2.alpha1~352 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d775ed07fc7054f1e99e0af92ee2afe1cbf1ffb2;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Update private index before updating saved search results. --- diff --git a/src/lib-storage/index/index-sync.c b/src/lib-storage/index/index-sync.c index 8b5316c6c5..82aab03aed 100644 --- a/src/lib-storage/index/index-sync.c +++ b/src/lib-storage/index/index-sync.c @@ -382,6 +382,12 @@ int index_mailbox_sync_deinit(struct mailbox_sync_context *_ctx, if (status_r != NULL) status_r->sync_delayed_expunges = delayed_expunges; + /* sync private index if needed. do this after real sync to make sure + that all the new messages are added to the private index, so their + flags can be updated. */ + (void)index_storage_mailbox_sync_pvt(_ctx->box); + + /* update search results after private index is updated */ index_sync_search_results_update(ctx); if (array_is_created(&ctx->flag_updates)) @@ -391,10 +397,6 @@ int index_mailbox_sync_deinit(struct mailbox_sync_context *_ctx, if (array_is_created(&ctx->all_flag_update_uids)) array_free(&ctx->all_flag_update_uids); - /* sync private index if needed. do this last to make sure that all - the new messages are added to the private index, so their flags can - be updated. */ - (void)index_storage_mailbox_sync_pvt(_ctx->box); i_free(ctx); return ret; }