From: Vincent Pit Date: Fri, 20 Nov 2015 15:54:15 +0000 (-0200) Subject: Fix callback argument passing in Xchat::XPI::Events X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=4d2f1a94053d536b838ab1601317dcfae36ad789;p=perl%2Fscripts%2Fxchat.git Fix callback argument passing in Xchat::XPI::Events --- diff --git a/Xchat/XPI/Events.pm b/Xchat/XPI/Events.pm index 0f120a5..3b3963b 100644 --- a/Xchat/XPI/Events.pm +++ b/Xchat/XPI/Events.pm @@ -21,7 +21,7 @@ sub _delay_cb { } sub delay { - my $delay = shift; + my ($delay, @args) = @_; if (defined $delay) { $delay = int $delay; @@ -30,7 +30,7 @@ sub delay { } called_from_script { - hook_timer $delay, \&_delay_cb, { data => \@_ } + hook_timer $delay, \&_delay_cb, { data => \@args } } } @@ -47,10 +47,10 @@ sub _filter_cb { } sub filter { - my $from = shift; + my ($from, $cb, $to) = @_; called_from_script { - hook_print $from, \&_filter_cb, { data => \@_ } + hook_print $from, \&_filter_cb, { data => [ $cb, $to ] } } }