]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mailbox_sync(): Don't add FIX_INCONSISTENT flag if there are saved search
authorTimo Sirainen <tss@iki.fi>
Sun, 8 Jun 2008 21:15:36 +0000 (00:15 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 8 Jun 2008 21:15:36 +0000 (00:15 +0300)
results, otherwise they won't be updated.

--HG--
branch : HEAD

src/lib-storage/mail-storage.c

index 2b065488fd12d83d939443d8c45923ac665b3d3d..c1b6055bd1b96b39700e015791b8e76a85c343a3 100644 (file)
@@ -543,9 +543,11 @@ int mailbox_sync(struct mailbox *box, enum mailbox_sync_flags flags,
        struct mailbox_sync_context *ctx;
         struct mailbox_sync_rec sync_rec;
 
-       /* we don't care about mailbox's current state, so we might as well
-          fix inconsistency state */
-       flags |= MAILBOX_SYNC_FLAG_FIX_INCONSISTENT;
+       if (array_count(&box->search_results) == 0) {
+               /* we don't care about mailbox's current state, so we might
+                  as well fix inconsistency state */
+               flags |= MAILBOX_SYNC_FLAG_FIX_INCONSISTENT;
+       }
 
        ctx = mailbox_sync_init(box, flags);
        while (mailbox_sync_next(ctx, &sync_rec))