]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Call next hook_mail_namespaces_created in correct order.
authorTimo Sirainen <tss@iki.fi>
Sun, 23 Nov 2008 22:08:03 +0000 (00:08 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 23 Nov 2008 22:08:03 +0000 (00:08 +0200)
--HG--
branch : HEAD

src/plugins/autocreate/autocreate-plugin.c
src/plugins/trash/trash-plugin.c

index bf5cf0e616797ef8929f2b217fedeaa5b7622311..d4a8adf25401448f1304fd698cc1fc1e692421e4 100644 (file)
@@ -55,11 +55,11 @@ static void autosubscribe_mailboxes(struct mail_namespace *namespaces)
 static void
 autocreate_mail_namespaces_created(struct mail_namespace *namespaces)
 {
-       if (autocreate_next_hook_mail_namespaces_created != NULL)
-               autocreate_next_hook_mail_namespaces_created(namespaces);
-
        autocreate_mailboxes(namespaces);
        autosubscribe_mailboxes(namespaces);
+
+       if (autocreate_next_hook_mail_namespaces_created != NULL)
+               autocreate_next_hook_mail_namespaces_created(namespaces);
 }
 
 void autocreate_plugin_init(void)
index 2870f0755f695f96504dbf505b783bf5d3680c1d..3381aa7cb21951672c95561568ce41a3815c01c5 100644 (file)
@@ -302,29 +302,25 @@ trash_hook_mail_namespaces_created(struct mail_namespace *namespaces)
        struct trash_user *tuser;
        const char *env;
 
-       if (trash_next_hook_mail_namespaces_created != NULL)
-               trash_next_hook_mail_namespaces_created(namespaces);
-
        env = getenv("TRASH");
        if (env == NULL) {
                if (getenv("DEBUG") != NULL)
                        i_info("trash: No trash setting - plugin disabled");
-               return;
-       }
-
-       if (quota_set == NULL) {
+       } else if (quota_set == NULL) {
                i_error("trash plugin: quota plugin not initialized");
-               return;
+       } else {
+               tuser = p_new(user->pool, struct trash_user, 1);
+               tuser->module_ctx.super = user->v;
+               MODULE_CONTEXT_SET(user, trash_user_module, tuser);
+
+               if (read_configuration(user, env) == 0) {
+                       trash_next_quota_test_alloc = quota_set->test_alloc;
+                       quota_set->test_alloc = trash_quota_test_alloc;
+               }
        }
 
-       tuser = p_new(user->pool, struct trash_user, 1);
-       tuser->module_ctx.super = user->v;
-       MODULE_CONTEXT_SET(user, trash_user_module, tuser);
-
-       if (read_configuration(user, env) == 0) {
-               trash_next_quota_test_alloc = quota_set->test_alloc;
-               quota_set->test_alloc = trash_quota_test_alloc;
-       }
+       if (trash_next_hook_mail_namespaces_created != NULL)
+               trash_next_hook_mail_namespaces_created(namespaces);
 }
 
 void trash_plugin_init(void)