]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Delay enabling modseqs until modseq>1 is seen.
authorTimo Sirainen <tss@iki.fi>
Fri, 13 Nov 2009 21:53:37 +0000 (16:53 -0500)
committerTimo Sirainen <tss@iki.fi>
Fri, 13 Nov 2009 21:53:37 +0000 (16:53 -0500)
--HG--
branch : HEAD

src/dsync/dsync-worker-local.c

index a15555c99bb0479a5e972f8f513c1cfdd3abf908..7642df507f0a0949e0c47e0c4ca2bfc36a8ef9e8 100644 (file)
@@ -419,7 +419,6 @@ static int local_mailbox_open(struct local_dsync_worker *worker,
                mailbox_close(&box);
                return -1;
        }
-       (void)mailbox_enable(box, MAILBOX_FEATURE_CONDSTORE);
 
        mailbox_get_status(box, STATUS_GUID, &status);
        if (memcmp(status.mailbox_guid, guid->guid, sizeof(guid->guid)) != 0) {
@@ -868,6 +867,11 @@ local_worker_msg_update_metadata(struct dsync_worker *_worker,
                (struct local_dsync_worker *)_worker;
        struct mail_keywords *keywords;
 
+       if (msg->modseq > 1) {
+               (void)mailbox_enable(worker->mail->box,
+                                    MAILBOX_FEATURE_CONDSTORE);
+       }
+
        if (!mail_set_uid(worker->mail, msg->uid))
                dsync_worker_set_failure(_worker);
        else {
@@ -910,6 +914,9 @@ local_worker_msg_save_set_metadata(struct mailbox *box,
 {
        struct mail_keywords *keywords;
 
+       if (msg->modseq > 1)
+               (void)mailbox_enable(box, MAILBOX_FEATURE_CONDSTORE);
+
        keywords = str_array_length(msg->keywords) == 0 ? NULL :
                mailbox_keywords_create_valid(box, msg->keywords);
        mailbox_save_set_flags(save_ctx, msg->flags, keywords);