From ae0e17cfe252e96082d88710dd35aa5e0782b91c Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 17 Feb 2006 14:59:07 +0000 Subject: [PATCH] Commands allowed when not connected to any server, fixed get_config: now needs exact option name to return value --- src/plugins/plugins-interface.c | 10 +++------- weechat/src/plugins/plugins-interface.c | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c index bd8cdd087..bd7470eb2 100644 --- a/src/plugins/plugins-interface.c +++ b/src/plugins/plugins-interface.c @@ -330,11 +330,7 @@ weechat_plugin_exec_command (t_weechat_plugin *plugin, else if (ptr_server && (ptr_server->buffer)) user_command (ptr_server, NULL, command); else - { - irc_display_prefix (NULL, NULL, PREFIX_ERROR); - gui_printf (NULL, _("%s server not found for plugin exec command\n"), - WEECHAT_ERROR); - } + user_command (NULL, NULL, command); } } @@ -566,7 +562,7 @@ weechat_plugin_get_config (t_weechat_plugin *plugin, char *option) { if ((!option) || ((option) && (option[0]) - && (strstr (weechat_options[i][j].option_name, option) != NULL))) + && (ascii_strcasecmp (weechat_options[i][j].option_name, option) == 0))) { return weechat_plugin_get_config_str_value (&weechat_options[i][j], NULL); } @@ -583,7 +579,7 @@ weechat_plugin_get_config (t_weechat_plugin *plugin, char *option) weechat_options[CONFIG_SECTION_SERVER][i].option_name); if ((!option) || ((option) && (option[0]) - && (strstr (option_name, option) != NULL))) + && (ascii_strcasecmp (option_name, option) == 0))) { ptr_option_value = config_get_server_option_ptr (ptr_server, weechat_options[CONFIG_SECTION_SERVER][i].option_name); diff --git a/weechat/src/plugins/plugins-interface.c b/weechat/src/plugins/plugins-interface.c index bd8cdd087..bd7470eb2 100644 --- a/weechat/src/plugins/plugins-interface.c +++ b/weechat/src/plugins/plugins-interface.c @@ -330,11 +330,7 @@ weechat_plugin_exec_command (t_weechat_plugin *plugin, else if (ptr_server && (ptr_server->buffer)) user_command (ptr_server, NULL, command); else - { - irc_display_prefix (NULL, NULL, PREFIX_ERROR); - gui_printf (NULL, _("%s server not found for plugin exec command\n"), - WEECHAT_ERROR); - } + user_command (NULL, NULL, command); } } @@ -566,7 +562,7 @@ weechat_plugin_get_config (t_weechat_plugin *plugin, char *option) { if ((!option) || ((option) && (option[0]) - && (strstr (weechat_options[i][j].option_name, option) != NULL))) + && (ascii_strcasecmp (weechat_options[i][j].option_name, option) == 0))) { return weechat_plugin_get_config_str_value (&weechat_options[i][j], NULL); } @@ -583,7 +579,7 @@ weechat_plugin_get_config (t_weechat_plugin *plugin, char *option) weechat_options[CONFIG_SECTION_SERVER][i].option_name); if ((!option) || ((option) && (option[0]) - && (strstr (option_name, option) != NULL))) + && (ascii_strcasecmp (option_name, option) == 0))) { ptr_option_value = config_get_server_option_ptr (ptr_server, weechat_options[CONFIG_SECTION_SERVER][i].option_name);