dovecot-2.0: dsync: Delay enabling modseqs until modseq>1 is seen.

dovecot at dovecot.org dovecot at dovecot.org
Fri Nov 13 23:55:10 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/00aba806af0b
changeset: 10322:00aba806af0b
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Nov 13 16:53:37 2009 -0500
description:
dsync: Delay enabling modseqs until modseq>1 is seen.

diffstat:

1 file changed, 8 insertions(+), 1 deletion(-)
src/dsync/dsync-worker-local.c |    9 ++++++++-

diffs (33 lines):

diff -r 2a2261f5a0be -r 00aba806af0b src/dsync/dsync-worker-local.c
--- a/src/dsync/dsync-worker-local.c	Fri Nov 13 16:53:14 2009 -0500
+++ b/src/dsync/dsync-worker-local.c	Fri Nov 13 16:53:37 2009 -0500
@@ -419,7 +419,6 @@ static int local_mailbox_open(struct loc
 		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 
 		(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 {
@@ -909,6 +913,9 @@ local_worker_msg_save_set_metadata(struc
 				   const struct dsync_message *msg)
 {
 	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);


More information about the dovecot-cvs mailing list