diff options
Diffstat (limited to 'src/plugins/scripts/weechat-script.c')
-rw-r--r-- | src/plugins/scripts/weechat-script.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/plugins/scripts/weechat-script.c b/src/plugins/scripts/weechat-script.c index 688ba6fce..636d121e3 100644 --- a/src/plugins/scripts/weechat-script.c +++ b/src/plugins/scripts/weechat-script.c @@ -184,7 +184,7 @@ weechat_script_remove_handler (t_weechat_plugin *plugin, t_plugin_handler *ptr_handler, *next_handler; char *ptr_arg1; - /* search and remove message handlers */ + /* search and remove handlers */ ptr_handler = plugin->handlers; while (ptr_handler) { @@ -209,6 +209,33 @@ weechat_script_remove_handler (t_weechat_plugin *plugin, } /* + * weechat_script_remove_timer_handler: remove a timer handler for a script + */ + +void +weechat_script_remove_timer_handler (t_weechat_plugin *plugin, + t_plugin_script *script, + char *function) +{ + t_plugin_handler *ptr_handler, *next_handler; + + /* search and remove timer handlers */ + ptr_handler = plugin->handlers; + while (ptr_handler) + { + if (((t_plugin_script *)ptr_handler->handler_pointer == script) + && (plugin->ascii_strcasecmp (plugin, ptr_handler->handler_args, function) == 0)) + { + next_handler = ptr_handler->next_handler; + plugin->handler_remove (plugin, ptr_handler); + ptr_handler = next_handler; + } + else + ptr_handler = ptr_handler->next_handler; + } +} + +/* * weechat_script_get_plugin_config: get a value of a script option * format in file is: plugin.script.option=value */ |