Mercurial > dovecot > original-hg > dovecot-2.1
changeset 11946:756752d91378
lazy-expunge: Use mailbox_list_created hook to override list methods.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 05 Aug 2010 17:07:56 +0100 |
parents | c92414173290 |
children | e77310eedfbb |
files | src/plugins/lazy-expunge/lazy-expunge-plugin.c |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c Thu Aug 05 17:07:35 2010 +0100 +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c Thu Aug 05 17:07:56 2010 +0100 @@ -490,11 +490,10 @@ } } -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 @@ 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 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 };