mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 12:26:40 +02:00
trigger: rename "once action" to "post action"
This commit is contained in:
@@ -44,7 +44,7 @@ struct t_weechat_plugin *weechat_trigger_plugin = NULL;
|
||||
|
||||
char *trigger_option_string[TRIGGER_NUM_OPTIONS] =
|
||||
{ "enabled", "hook", "arguments", "conditions", "regex", "command",
|
||||
"return_code", "once_action" };
|
||||
"return_code", "post_action" };
|
||||
char *trigger_option_default[TRIGGER_NUM_OPTIONS] =
|
||||
{ "on", "signal", "", "", "", "", "ok", "none" };
|
||||
|
||||
@@ -69,7 +69,7 @@ char *trigger_return_code_string[TRIGGER_NUM_RETURN_CODES] =
|
||||
int trigger_return_code[TRIGGER_NUM_RETURN_CODES] =
|
||||
{ WEECHAT_RC_OK, WEECHAT_RC_OK_EAT, WEECHAT_RC_ERROR };
|
||||
|
||||
char *trigger_once_action_string[TRIGGER_NUM_ONCE_ACTIONS] =
|
||||
char *trigger_post_action_string[TRIGGER_NUM_POST_ACTIONS] =
|
||||
{ "none", "disable", "delete" };
|
||||
|
||||
struct t_trigger *triggers = NULL; /* first trigger */
|
||||
@@ -149,23 +149,23 @@ trigger_search_return_code (const char *return_code)
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for trigger once action.
|
||||
* Searches for trigger post action.
|
||||
*
|
||||
* Returns index of once action in enum t_trigger_once_action, -1 if not found.
|
||||
* Returns index of post action in enum t_trigger_post_action, -1 if not found.
|
||||
*/
|
||||
|
||||
int
|
||||
trigger_search_once_action (const char *once_action)
|
||||
trigger_search_post_action (const char *post_action)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < TRIGGER_NUM_ONCE_ACTIONS; i++)
|
||||
for (i = 0; i < TRIGGER_NUM_POST_ACTIONS; i++)
|
||||
{
|
||||
if (weechat_strcasecmp (trigger_once_action_string[i], once_action) == 0)
|
||||
if (weechat_strcasecmp (trigger_post_action_string[i], post_action) == 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
/* once action not found */
|
||||
/* post action not found */
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -897,7 +897,7 @@ struct t_trigger *
|
||||
trigger_new (const char *name, const char *enabled, const char *hook,
|
||||
const char *arguments, const char *conditions, const char *regex,
|
||||
const char *command, const char *return_code,
|
||||
const char *once_action)
|
||||
const char *post_action)
|
||||
{
|
||||
struct t_config_option *option[TRIGGER_NUM_OPTIONS];
|
||||
const char *value[TRIGGER_NUM_OPTIONS];
|
||||
@@ -915,9 +915,9 @@ trigger_new (const char *name, const char *enabled, const char *hook,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* look for once action */
|
||||
if (once_action && once_action[0]
|
||||
&& (trigger_search_once_action (once_action) < 0))
|
||||
/* look for post action */
|
||||
if (post_action && post_action[0]
|
||||
&& (trigger_search_post_action (post_action) < 0))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -929,7 +929,7 @@ trigger_new (const char *name, const char *enabled, const char *hook,
|
||||
value[TRIGGER_OPTION_REGEX] = regex;
|
||||
value[TRIGGER_OPTION_COMMAND] = command;
|
||||
value[TRIGGER_OPTION_RETURN_CODE] = return_code;
|
||||
value[TRIGGER_OPTION_ONCE_ACTION] = once_action;
|
||||
value[TRIGGER_OPTION_POST_ACTION] = post_action;
|
||||
|
||||
for (i = 0; i < TRIGGER_NUM_OPTIONS; i++)
|
||||
{
|
||||
@@ -967,7 +967,7 @@ trigger_create_default ()
|
||||
trigger_config_default_list[i][5], /* regex */
|
||||
trigger_config_default_list[i][6], /* command */
|
||||
trigger_config_default_list[i][7], /* return code */
|
||||
trigger_config_default_list[i][8]); /* once action */
|
||||
trigger_config_default_list[i][8]); /* post action */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1052,7 +1052,7 @@ trigger_copy (struct t_trigger *trigger, const char *name)
|
||||
weechat_config_string (trigger->options[TRIGGER_OPTION_REGEX]),
|
||||
weechat_config_string (trigger->options[TRIGGER_OPTION_COMMAND]),
|
||||
weechat_config_string (trigger->options[TRIGGER_OPTION_RETURN_CODE]),
|
||||
weechat_config_string (trigger->options[TRIGGER_OPTION_ONCE_ACTION]));
|
||||
weechat_config_string (trigger->options[TRIGGER_OPTION_POST_ACTION]));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1140,9 +1140,9 @@ trigger_print_log ()
|
||||
weechat_log_printf (" return_code . . . . . . : %d ('%s')",
|
||||
weechat_config_integer (ptr_trigger->options[TRIGGER_OPTION_RETURN_CODE]),
|
||||
trigger_return_code_string[weechat_config_integer (ptr_trigger->options[TRIGGER_OPTION_RETURN_CODE])]);
|
||||
weechat_log_printf (" once_action . . . . . . : %d ('%s')",
|
||||
weechat_config_integer (ptr_trigger->options[TRIGGER_OPTION_ONCE_ACTION]),
|
||||
trigger_once_action_string[weechat_config_integer (ptr_trigger->options[TRIGGER_OPTION_ONCE_ACTION])]);
|
||||
weechat_log_printf (" post_action . . . . . . : %d ('%s')",
|
||||
weechat_config_integer (ptr_trigger->options[TRIGGER_OPTION_POST_ACTION]),
|
||||
trigger_post_action_string[weechat_config_integer (ptr_trigger->options[TRIGGER_OPTION_POST_ACTION])]);
|
||||
weechat_log_printf (" hooks_count . . . . . . : %d", ptr_trigger->hooks_count);
|
||||
weechat_log_printf (" hooks . . . . . . . . . : 0x%lx", ptr_trigger->hooks);
|
||||
for (i = 0; i < ptr_trigger->hooks_count; i++)
|
||||
|
||||
Reference in New Issue
Block a user