]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-* plugins: Use the new imap_client_created_hook_set() to set the hook.
authorTimo Sirainen <tss@iki.fi>
Mon, 4 Oct 2010 14:13:20 +0000 (15:13 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 4 Oct 2010 14:13:20 +0000 (15:13 +0100)
This avoids accessing variables directly, which allows Dovecot to give better
error messages if imap-* plugins are tried to be loaded by non-imap binary.

src/plugins/imap-acl/imap-acl-plugin.c
src/plugins/imap-quota/imap-quota-plugin.c
src/plugins/imap-zlib/imap-zlib-plugin.c

index d6ae3a3eaee6ab95820261b5f5f03d86f2d8978f..e160b8eb852c17eb52f0257b7fcc1cece2e7aec6 100644 (file)
@@ -684,8 +684,8 @@ void imap_acl_plugin_init(struct module *module)
        command_register("DELETEACL", cmd_deleteacl, 0);
 
        imap_acl_module = module;
-       next_hook_client_created = hook_client_created;
-       hook_client_created = imap_acl_client_created;
+       next_hook_client_created =
+               imap_client_created_hook_set(imap_acl_client_created);
 }
 
 void imap_acl_plugin_deinit(void)
@@ -696,7 +696,7 @@ void imap_acl_plugin_deinit(void)
        command_unregister("DELETEACL");
        command_unregister("LISTRIGHTS");
 
-       hook_client_created = next_hook_client_created;
+       imap_client_created_hook_set(next_hook_client_created);
 }
 
 const char *imap_acl_plugin_dependencies[] = { "acl", NULL };
index f4629aba352839556c5f8c6745a733a9991b18a0..f06a2ccf3c37e1f814eb15ed6e427eee473d4df8 100644 (file)
@@ -221,8 +221,8 @@ void imap_quota_plugin_init(struct module *module)
        command_register("SETQUOTA", cmd_setquota, 0);
 
        imap_quota_module = module;
-       next_hook_client_created = hook_client_created;
-       hook_client_created = imap_quota_client_created;
+       next_hook_client_created =
+               imap_client_created_hook_set(imap_quota_client_created);
 }
 
 void imap_quota_plugin_deinit(void)
@@ -231,7 +231,7 @@ void imap_quota_plugin_deinit(void)
        command_unregister("GETQUOTA");
        command_unregister("SETQUOTA");
 
-       hook_client_created = next_hook_client_created;
+       imap_client_created_hook_set(next_hook_client_created);
 }
 
 const char *imap_quota_plugin_dependencies[] = { "quota", NULL };
index 74b0925379d4dd058f50e058b5490047c6b43929..7f42d9c7b149ca9b62a4e11b88737fbd1a2d724e 100644 (file)
@@ -145,15 +145,15 @@ void imap_zlib_plugin_init(struct module *module)
        command_register("COMPRESS", cmd_compress, 0);
 
        imap_zlib_module = module;
-       next_hook_client_created = hook_client_created;
-       hook_client_created = imap_zlib_client_created;
+       next_hook_client_created =
+               imap_client_created_hook_set(imap_zlib_client_created);
 }
 
 void imap_zlib_plugin_deinit(void)
 {
        command_unregister("COMPRESS");
 
-       hook_client_created = next_hook_client_created;
+       imap_client_created_hook_set(next_hook_client_created);
 }
 
 const char *imap_zlib_plugin_dependencies[] = { "zlib", NULL };