1
0
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:
Sebastien Helleu
2014-03-01 17:25:48 +01:00
parent 050d2023d6
commit 44b8447ff0
20 changed files with 37 additions and 50 deletions
+1 -2
View File
@@ -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"
+3 -3
View File
@@ -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]