changeset 12237:1df6a392a613

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.
author Timo Sirainen <tss@iki.fi>
date Mon, 04 Oct 2010 15:13:20 +0100
parents 31a34cff1ebe
children 2b8b2875af26
files src/plugins/imap-acl/imap-acl-plugin.c src/plugins/imap-quota/imap-quota-plugin.c src/plugins/imap-zlib/imap-zlib-plugin.c
diffstat 3 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/imap-acl/imap-acl-plugin.c	Mon Oct 04 15:12:23 2010 +0100
+++ b/src/plugins/imap-acl/imap-acl-plugin.c	Mon Oct 04 15:13:20 2010 +0100
@@ -684,8 +684,8 @@
 	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 @@
 	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 };
--- a/src/plugins/imap-quota/imap-quota-plugin.c	Mon Oct 04 15:12:23 2010 +0100
+++ b/src/plugins/imap-quota/imap-quota-plugin.c	Mon Oct 04 15:13:20 2010 +0100
@@ -221,8 +221,8 @@
 	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 @@
 	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 };
--- a/src/plugins/imap-zlib/imap-zlib-plugin.c	Mon Oct 04 15:12:23 2010 +0100
+++ b/src/plugins/imap-zlib/imap-zlib-plugin.c	Mon Oct 04 15:13:20 2010 +0100
@@ -145,15 +145,15 @@
 	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 };