From 6715c5db10eb1fb063fef7fb0e230161229751dd Mon Sep 17 00:00:00 2001 From: Yorhel Date: Wed, 5 Aug 2009 10:26:31 +0200 Subject: Multi::IRC: Don't listen to unaddressed commands without the ! trigger Tiny bug introduced in a recent commit. --- lib/Multi/IRC.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Multi/IRC.pm b/lib/Multi/IRC.pm index c35c0f9c..4909cd43 100644 --- a/lib/Multi/IRC.pm +++ b/lib/Multi/IRC.pm @@ -161,13 +161,13 @@ sub command { # mask, dest, msg my $me = $irc->nick_name(); my $addressed = $dest->[0] !~ /^#/ || $msg =~ s/^\s*\Q$me\E[:,;.!?~]?\s*//; + return 0 if !$addressed && !($msg =~ s/^\s*!//); - my $usr = parse_user($mask); - $msg =~ s/\s*!//; return 0 if $msg !~ /^([a-z]+)(?:\s+(.+))?$/; my($cmd, $arg) = ($1, $2); return 0 if !exists $_[HEAP]{commands}{$cmd} || ($_[HEAP]{commands}{$cmd} & 8) && !$addressed; + my $usr = parse_user($mask); return $_[KERNEL]->yield(reply => $dest, $dest eq $_[HEAP]{channels}[0] ? 'Only OPs can do that!' : "Only $_[HEAP]{channel}[0] OPs can do that!", $usr) || 1 if $_[HEAP]{commands}{$cmd} == 1 && !$irc->is_channel_operator($_[HEAP]{channels}[0], $usr); -- cgit v1.2.3