From 945edfaf54fc0f26fe2d18e4c8733055c2b239d4 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Tue, 15 Feb 2011 19:00:18 -0700 Subject: [PATCH] Accept JOIN with or without colon. --- lib/Parser/IRC.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Parser/IRC.pm b/lib/Parser/IRC.pm index 1317ee8..a6bd379 100644 --- a/lib/Parser/IRC.pm +++ b/lib/Parser/IRC.pm @@ -298,16 +298,18 @@ sub cjoin { my ($svr, @ex) = @_; my %src = API::IRC::usrc(substr($ex[0], 1)); + my $chan = $ex[2]; + if ($chan =~ m/^:/xsm) { $chan = substr $chan, 1; } # Check if this is coming from ourselves. if ($src{nick} eq $botnick{$svr}{nick}) { $botchans{$svr}{lc(substr $ex[2], 1)} = 1; - API::Std::event_run("on_ucjoin", ($svr, substr($ex[2], 1))); + API::Std::event_run("on_ucjoin", ($svr, $chan)); } else { # It isn't. Update chanusers and trigger on_rcjoin. $chanusers{$svr}{lc(substr $ex[2], 1)}{$src{nick}} = 1; - API::Std::event_run("on_rcjoin", ($svr, \%src, substr($ex[2], 1))); + API::Std::event_run("on_rcjoin", ($svr, \%src, $chan)); } return 1;