From bad3169336be6ea1e4f16f6bf5a6cd768a6ea607 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Tue, 15 Feb 2011 18:33:09 -0700 Subject: [PATCH] on_notice now sends the proper arguments. --- doc/CHANGELOG | 1 + lib/Parser/IRC.pm | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 6618054..24ff5c5 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * Changed on_notice arguments to: \%src, $target, @msg * Clean up shutdown. * Created event on_shutdown. * Shutdown if there are no more IRC connections. diff --git a/lib/Parser/IRC.pm b/lib/Parser/IRC.pm index 9bdf539..1317ee8 100644 --- a/lib/Parser/IRC.pm +++ b/lib/Parser/IRC.pm @@ -480,8 +480,16 @@ sub nick sub notice { my ($svr, @ex) = @_; + + # Prepare all the data. + my %src = API::IRC::usrc(substr $ex[0], 1); + my $target = $ex[2]; + shift @ex; shift @ex; shift @ex; + $ex[0] = substr $ex[0], 1; + $src{svr} = $svr; - API::Std::event_run("on_notice", ($svr, @ex)); + # Send it off. + API::Std::event_run("on_notice", (\%src, $target, @ex)); return 1; }