]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mailbox_enable() shouldn't actually open the mailbox.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 Mar 2012 11:19:03 +0000 (13:19 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 Mar 2012 11:19:03 +0000 (13:19 +0200)
This combined with mailbox_get_status() never synced the mailbox, so if
there were any changes they weren't visible in STATUS reply.

src/lib-storage/index/index-storage.c

index c7c83bb0d30fade7b7de9d35cf726195ec0c9c6f..6c965ef3561d1722c2b34def11d7281f40df5e77 100644 (file)
@@ -272,6 +272,9 @@ int index_storage_mailbox_open(struct mailbox *box, bool move_to_memory)
 
        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 @@ void index_storage_mailbox_alloc(struct mailbox *box, const char *vname,
 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;
 }