# HG changeset patch # User Timo Sirainen # Date 1190465368 -10800 # Node ID d4df001f9bd05143310acee805cc014c72959c74 # Parent c6849b4a38120e85d5b18c5fe3d137713d33ffdc Mark lazy expunge's namespaces as internal so quota doesn't count them. diff -r c6849b4a3812 -r d4df001f9bd0 src/plugins/lazy-expunge/lazy-expunge-plugin.c --- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c Sat Sep 22 15:49:02 2007 +0300 +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c Sat Sep 22 15:49:28 2007 +0300 @@ -475,6 +475,8 @@ struct lazy_expunge_mailbox_list *llist = LAZY_EXPUNGE_LIST_CONTEXT(storage->list); struct lazy_expunge_mail_storage *lstorage; + const char *const *p; + unsigned int i; if (lazy_expunge_next_hook_mail_storage_created != NULL) lazy_expunge_next_hook_mail_storage_created(storage); @@ -483,6 +485,18 @@ if (strcmp(storage->name, "maildir") != 0) return; + /* if this is one of our internal storages, mark it as such before + quota plugin sees it */ + t_push(); + p = t_strsplit_spaces(getenv("LAZY_EXPUNGE"), " "); + for (i = 0; i < LAZY_NAMESPACE_COUNT; i++, p++) { + if (strcmp(storage->ns->prefix, *p) == 0) { + lazy_namespaces[i]->flags |= NAMESPACE_FLAG_INTERNAL; + break; + } + } + t_pop(); + llist->storage = storage; lstorage = p_new(storage->pool, struct lazy_expunge_mail_storage, 1); @@ -517,7 +531,7 @@ lazy_expunge_next_hook_mail_namespaces_created(namespaces); t_push(); - p = t_strsplit(getenv("LAZY_EXPUNGE"), " "); + p = t_strsplit_spaces(getenv("LAZY_EXPUNGE"), " "); for (i = 0; i < LAZY_NAMESPACE_COUNT; i++, p++) { const char *name = *p; @@ -551,8 +565,7 @@ hook_mail_namespaces_created = lazy_expunge_hook_mail_namespaces_created; - lazy_expunge_next_hook_mail_storage_created = - hook_mail_storage_created; + lazy_expunge_next_hook_mail_storage_created = hook_mail_storage_created; hook_mail_storage_created = lazy_expunge_mail_storage_created; lazy_expunge_next_hook_mailbox_list_created = hook_mailbox_list_created;