Ejemplo n.º 1
0
void
trigger_command_list_default (int verbose)
{
    int i, regex_count, commands_count;
    struct t_trigger_regex *regex;
    char **commands;

    regex_count = 0;
    regex = NULL;
    commands_count = 0;
    commands = NULL;

    weechat_printf_date_tags (NULL, 0, "no_trigger", "");
    weechat_printf_date_tags (NULL, 0, "no_trigger",
                              _("List of default triggers:"));

    for (i = 0; trigger_config_default_list[i][0]; i++)
    {
        if (trigger_regex_split (trigger_config_default_list[i][5],
                                 &regex_count,
                                 &regex) < 0)
            continue;
        trigger_split_command (trigger_config_default_list[i][6],
                               &commands_count,
                               &commands);
        trigger_command_display_trigger_internal (
            trigger_config_default_list[i][0],
            weechat_config_string_to_boolean (trigger_config_default_list[i][1]),
            trigger_config_default_list[i][2],
            trigger_config_default_list[i][3],
            trigger_config_default_list[i][4],
            0,
            0,
            0,
            regex_count,
            regex,
            commands_count,
            commands,
            trigger_search_return_code (trigger_config_default_list[i][7]),
            verbose);
    }

    trigger_regex_free (&regex_count, &regex);
    if (commands)
        weechat_string_free_split (commands);
}
Ejemplo n.º 2
0
void
trigger_command_display_trigger (struct t_trigger *trigger, int verbose)
{
    trigger_command_display_trigger_internal (
        trigger->name,
        weechat_config_boolean (trigger->options[TRIGGER_OPTION_ENABLED]),
        weechat_config_string (trigger->options[TRIGGER_OPTION_HOOK]),
        weechat_config_string (trigger->options[TRIGGER_OPTION_ARGUMENTS]),
        weechat_config_string (trigger->options[TRIGGER_OPTION_CONDITIONS]),
        trigger->hooks_count,
        trigger->hook_count_cb,
        trigger->hook_count_cmd,
        trigger->regex_count,
        trigger->regex,
        trigger->commands_count,
        trigger->commands,
        weechat_config_integer (trigger->options[TRIGGER_OPTION_RETURN_CODE]),
        verbose);
}