From 8c29bbf5a2385318acbff11a6a7f2ee550be2beb Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 13 Nov 2009 16:53:37 -0500 Subject: [PATCH] dsync: Delay enabling modseqs until modseq>1 is seen. --HG-- branch : HEAD --- src/dsync/dsync-worker-local.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/dsync/dsync-worker-local.c b/src/dsync/dsync-worker-local.c index a15555c99b..7642df507f 100644 --- a/src/dsync/dsync-worker-local.c +++ b/src/dsync/dsync-worker-local.c @@ -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); -- 2.47.3