dovecot-2.0: lib-storage: Use module_get_plugin_name() instead o...

dovecot at dovecot.org dovecot at dovecot.org
Mon Dec 7 21:45:58 EET 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/784d2920761f
changeset: 10417:784d2920761f
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Dec 07 14:43:11 2009 -0500
description:
lib-storage: Use module_get_plugin_name() instead of doing it ourself.

diffstat:

1 file changed, 1 insertion(+), 6 deletions(-)
src/lib-storage/mail-storage-hooks.c |    7 +------

diffs (22 lines):

diff -r f0a6461b86ee -r 784d2920761f src/lib-storage/mail-storage-hooks.c
--- a/src/lib-storage/mail-storage-hooks.c	Mon Dec 07 14:42:57 2009 -0500
+++ b/src/lib-storage/mail-storage-hooks.c	Mon Dec 07 14:43:11 2009 -0500
@@ -98,17 +98,12 @@ static void mail_user_add_plugin_hooks(s
 	const struct mail_storage_module_hooks *module_hook;
 	ARRAY_DEFINE(tmp_hooks, struct mail_storage_module_hooks);
 	const char *const *plugins, *name;
-	unsigned int len;
 
 	/* first get all hooks wanted by the user */
 	t_array_init(&tmp_hooks, array_count(&module_hooks));
 	plugins = t_strsplit_spaces(user->set->mail_plugins, ", ");
 	array_foreach(&module_hooks, module_hook) {
-		name = module_hook->module->name;
-		len = strlen(name);
-		if (len > 7 && strcmp(name + len - 7, "_plugin") == 0)
-			name = t_strndup(name, len - 7);
-
+		name = module_get_plugin_name(module_hook->module);
 		if (str_array_find(plugins, name))
 			array_append(&tmp_hooks, module_hook, 1);
 	}


More information about the dovecot-cvs mailing list