From: Timo Sirainen Date: Thu, 5 Aug 2010 16:07:56 +0000 (+0100) Subject: lazy-expunge: Use mailbox_list_created hook to override list methods. X-Git-Tag: 2.0.rc5~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f6a5f61c4fafd999ad57052af12753f0f8342abe;p=thirdparty%2Fdovecot%2Fcore.git lazy-expunge: Use mailbox_list_created hook to override list methods. --- diff --git a/src/plugins/lazy-expunge/lazy-expunge-plugin.c b/src/plugins/lazy-expunge/lazy-expunge-plugin.c index abae315eb0..218daafd2e 100644 --- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c @@ -490,11 +490,10 @@ static void lazy_expunge_mailbox_allocated(struct mailbox *box) } } -static void lazy_expunge_mail_namespace_storage_added(struct mail_namespace *ns) +static void lazy_expunge_mailbox_list_created(struct mailbox_list *list) { - struct mailbox_list *list = ns->list; struct lazy_expunge_mail_user *luser = - LAZY_EXPUNGE_USER_CONTEXT(ns->user); + LAZY_EXPUNGE_USER_CONTEXT(list->ns->user); struct lazy_expunge_mailbox_list *llist; const char *const *p; unsigned int i; @@ -506,13 +505,13 @@ static void lazy_expunge_mail_namespace_storage_added(struct mail_namespace *ns) quota plugin sees it */ p = t_strsplit_spaces(luser->env, " "); for (i = 0; i < LAZY_NAMESPACE_COUNT && *p != NULL; i++, p++) { - if (strcmp(ns->prefix, *p) == 0) { - ns->flags |= NAMESPACE_FLAG_NOQUOTA; + if (strcmp(list->ns->prefix, *p) == 0) { + list->ns->flags |= NAMESPACE_FLAG_NOQUOTA; break; } } - if (luser != NULL && ns->type == NAMESPACE_PRIVATE) { + if (luser != NULL && list->ns->type == NAMESPACE_PRIVATE) { llist = p_new(list->pool, struct lazy_expunge_mailbox_list, 1); MODULE_CONTEXT_SET(list, lazy_expunge_mailbox_list_module, llist); @@ -589,7 +588,7 @@ static void lazy_expunge_mail_user_created(struct mail_user *user) static struct mail_storage_hooks lazy_expunge_mail_storage_hooks = { .mail_user_created = lazy_expunge_mail_user_created, .mail_namespaces_created = lazy_expunge_mail_namespaces_created, - .mail_namespace_storage_added = lazy_expunge_mail_namespace_storage_added, + .mailbox_list_created = lazy_expunge_mailbox_list_created, .mailbox_allocated = lazy_expunge_mailbox_allocated, .mail_allocated = lazy_expunge_mail_allocated };