mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 05:46:38 +02:00
trigger: make optional the alignment on second and max calls (in hook timer)
This commit is contained in:
@@ -915,8 +915,7 @@ trigger_command_init ()
|
||||
" command: command (required), description, arguments, "
|
||||
"description of arguments, completion\n"
|
||||
" command_run: command (required)\n"
|
||||
" timer: interval (required), align on second (required), "
|
||||
"max calls (required)\n"
|
||||
" timer: interval (required), align on second, max calls\n"
|
||||
" config: name of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
|
||||
@@ -365,14 +365,14 @@ trigger_hook (struct t_trigger *trigger)
|
||||
}
|
||||
break;
|
||||
case TRIGGER_HOOK_TIMER:
|
||||
if (argv && (argc >= 3))
|
||||
if (argv && (argc >= 1))
|
||||
{
|
||||
error1 = NULL;
|
||||
error2 = NULL;
|
||||
error3 = NULL;
|
||||
interval = strtol (argv[0], &error1, 10);
|
||||
align_second = strtol (argv[1], &error2, 10);
|
||||
max_calls = strtol (argv[2], &error3, 10);
|
||||
align_second = strtol ((argc >= 2) ? argv[1] : "0", &error2, 10);
|
||||
max_calls = strtol ((argc >= 3) ? argv[2] : "0", &error3, 10);
|
||||
if (error1 && !error1[0]
|
||||
&& error2 && !error2[0]
|
||||
&& error3 && !error3[0]
|
||||
|
||||
Reference in New Issue
Block a user