From: Timo Sirainen Date: Mon, 4 Oct 2010 14:13:20 +0000 (+0100) Subject: imap-* plugins: Use the new imap_client_created_hook_set() to set the hook. X-Git-Tag: 2.0.6~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac0fed903142d28ae3a1d5d00d2097fdf161b138;p=thirdparty%2Fdovecot%2Fcore.git imap-* plugins: Use the new imap_client_created_hook_set() to set the hook. 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. --- diff --git a/src/plugins/imap-acl/imap-acl-plugin.c b/src/plugins/imap-acl/imap-acl-plugin.c index d6ae3a3eae..e160b8eb85 100644 --- a/src/plugins/imap-acl/imap-acl-plugin.c +++ b/src/plugins/imap-acl/imap-acl-plugin.c @@ -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 }; diff --git a/src/plugins/imap-quota/imap-quota-plugin.c b/src/plugins/imap-quota/imap-quota-plugin.c index f4629aba35..f06a2ccf3c 100644 --- a/src/plugins/imap-quota/imap-quota-plugin.c +++ b/src/plugins/imap-quota/imap-quota-plugin.c @@ -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 }; diff --git a/src/plugins/imap-zlib/imap-zlib-plugin.c b/src/plugins/imap-zlib/imap-zlib-plugin.c index 74b0925379..7f42d9c7b1 100644 --- a/src/plugins/imap-zlib/imap-zlib-plugin.c +++ b/src/plugins/imap-zlib/imap-zlib-plugin.c @@ -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 };