changeset 14277:8cbc130c2b72

lib-storage: mailbox_enable() shouldn't actually open the mailbox. This combined with mailbox_get_status() never synced the mailbox, so if there were any changes they weren't visible in STATUS reply.
author Timo Sirainen <tss@iki.fi>
date Sun, 04 Mar 2012 13:19:03 +0200
parents 9c6eeeb810c0
children 31ae11fe18b2
files src/lib-storage/index/index-storage.c
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-storage.c	Sun Mar 04 13:01:09 2012 +0200
+++ b/src/lib-storage/index/index-storage.c	Sun Mar 04 13:19:03 2012 +0200
@@ -272,6 +272,9 @@
 
 	box->opened = TRUE;
 
+	if ((box->enabled_features & MAILBOX_FEATURE_CONDSTORE) != 0)
+		mail_index_modseq_enable(box->index);
+
 	index_thread_mailbox_opened(box);
 	hook_mailbox_opened(box);
 	return 0;
@@ -313,14 +316,8 @@
 int index_storage_mailbox_enable(struct mailbox *box,
 				 enum mailbox_feature feature)
 {
-	if ((feature & MAILBOX_FEATURE_CONDSTORE) != 0) {
+	if ((feature & MAILBOX_FEATURE_CONDSTORE) != 0)
 		box->enabled_features |= MAILBOX_FEATURE_CONDSTORE;
-		if (mailbox_open(box) < 0)
-			return -1;
-		T_BEGIN {
-			mail_index_modseq_enable(box->index);
-		} T_END;
-	}
 	return 0;
 }