From: Timo Sirainen Date: Thu, 11 Apr 2013 16:06:25 +0000 (+0300) Subject: lib-storage: mailbox_list_index=yes was broken by previous change. X-Git-Tag: 2.2.0~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94785d5f7d1ca1d5830b6d342aa1fe126643f2f7;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mailbox_list_index=yes was broken by previous change. Reverted the previous change and fixed it the right way. --- diff --git a/src/lib-storage/list/mailbox-list-index.c b/src/lib-storage/list/mailbox-list-index.c index 37c6772d95..1f2dbedab9 100644 --- a/src/lib-storage/list/mailbox-list-index.c +++ b/src/lib-storage/list/mailbox-list-index.c @@ -536,8 +536,9 @@ mailbox_list_index_set_subscribed(struct mailbox_list *_list, return 0; } -static void mailbox_list_index_created_last(struct mailbox_list *list) +static void mailbox_list_index_created(struct mailbox_list *list) { + struct mailbox_list_vfuncs *v = list->vlast; struct mailbox_list_index *ilist; bool has_backing_store; @@ -555,24 +556,25 @@ static void mailbox_list_index_created_last(struct mailbox_list *list) } ilist = p_new(list->pool, struct mailbox_list_index, 1); - ilist->module_ctx.super = list->v; + ilist->module_ctx.super = *v; + list->vlast = &ilist->module_ctx.super; ilist->has_backing_store = has_backing_store; ilist->pending_init = TRUE; - list->v.deinit = mailbox_list_index_deinit; - list->v.iter_init = mailbox_list_index_iter_init; - list->v.iter_deinit = mailbox_list_index_iter_deinit; - list->v.iter_next = mailbox_list_index_iter_next; + v->deinit = mailbox_list_index_deinit; + v->iter_init = mailbox_list_index_iter_init; + v->iter_deinit = mailbox_list_index_iter_deinit; + v->iter_next = mailbox_list_index_iter_next; - list->v.delete_mailbox = mailbox_list_index_delete_mailbox; - list->v.delete_dir = mailbox_list_index_delete_dir; - list->v.rename_mailbox = mailbox_list_index_rename_mailbox; - list->v.set_subscribed = mailbox_list_index_set_subscribed; + v->delete_mailbox = mailbox_list_index_delete_mailbox; + v->delete_dir = mailbox_list_index_delete_dir; + v->rename_mailbox = mailbox_list_index_rename_mailbox; + v->set_subscribed = mailbox_list_index_set_subscribed; - list->v.notify_init = mailbox_list_index_notify_init; - list->v.notify_next = mailbox_list_index_notify_next; - list->v.notify_deinit = mailbox_list_index_notify_deinit; - list->v.notify_wait = mailbox_list_index_notify_wait; + v->notify_init = mailbox_list_index_notify_init; + v->notify_next = mailbox_list_index_notify_next; + v->notify_deinit = mailbox_list_index_notify_deinit; + v->notify_wait = mailbox_list_index_notify_wait; MODULE_CONTEXT_SET(list, mailbox_list_index_module, ilist); } @@ -643,24 +645,6 @@ static void mailbox_list_index_mailbox_allocated(struct mailbox *box) mailbox_list_index_backend_init_mailbox(box); } -static struct mail_storage_hooks mailbox_list_index_hooks_last = { - .mailbox_list_created = mailbox_list_index_created_last -}; -static bool mailbox_list_index_hooks_last_added = FALSE; - -static void mailbox_list_index_created(struct mailbox_list *list ATTR_UNUSED) -{ - /* We want our mailbox list index hooks to be called just before the - backend methods are called. Most importantly the ACL plugin's hooks - must be called before us, otherwise we'll end up skipping them and - showing all the mailboxes. So we do this dual-registration where - this second one gets us into the correct position. */ - if (!mailbox_list_index_hooks_last_added) { - mailbox_list_index_hooks_last_added = TRUE; - mail_storage_hooks_add_internal(&mailbox_list_index_hooks_last); - } -} - static struct mail_storage_hooks mailbox_list_index_hooks = { .mailbox_list_created = mailbox_list_index_created, .mail_namespaces_added = mailbox_list_index_namespaces_added,