1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 19:23:13 +02:00

trigger: do not hook anything if the trigger is disabled (closes #405)

This commit is contained in:
Sébastien Helleu
2015-04-18 10:04:26 +02:00
parent 32d165f1c4
commit 1054339be7
3 changed files with 6 additions and 3 deletions
-1
View File
@@ -353,7 +353,6 @@ trigger_command_set_enabled (struct t_trigger *trigger,
{
if (weechat_config_boolean (trigger->options[TRIGGER_OPTION_ENABLED]))
{
trigger_unhook (trigger);
trigger_hook (trigger);
weechat_printf_tags (NULL, "no_trigger",
_("Trigger \"%s\" restarted"),
+5 -2
View File
@@ -242,6 +242,9 @@ trigger_hook (struct t_trigger *trigger)
int i, argc, strip_colors;
long interval, align_second, max_calls;
if (!weechat_config_boolean (trigger->options[TRIGGER_OPTION_ENABLED]))
return;
trigger_unhook (trigger);
argv = weechat_string_split (weechat_config_string (trigger->options[TRIGGER_OPTION_ARGUMENTS]),
@@ -850,12 +853,12 @@ trigger_new_with_options (const char *name, struct t_config_option **options)
weechat_prefix ("error"), TRIGGER_PLUGIN_NAME,
name);
}
trigger_split_command (weechat_config_string (new_trigger->options[TRIGGER_OPTION_COMMAND]),
&new_trigger->commands_count,
&new_trigger->commands);
if (weechat_config_boolean (new_trigger->options[TRIGGER_OPTION_ENABLED]))
trigger_hook (new_trigger);
trigger_hook (new_trigger);
return new_trigger;
}