]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Update private index before updating saved search results.
authorTimo Sirainen <tss@iki.fi>
Sun, 12 Aug 2012 04:21:00 +0000 (07:21 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 12 Aug 2012 04:21:00 +0000 (07:21 +0300)
src/lib-storage/index/index-sync.c

index 8b5316c6c5183454001fca4209b5c3bff48eaf44..82aab03aed875bacb543999346b8f92775504a77 100644 (file)
@@ -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;
 }