summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-08-05 10:26:31 +0200
committerYorhel <git@yorhel.nl>2009-08-05 10:26:31 +0200
commit6715c5db10eb1fb063fef7fb0e230161229751dd (patch)
treefe1705a9b305d86e1c97c57e0258d0dba4a0da16
parenta3a3e1cea87fee3c716601ddf1606a06527bab32 (diff)
Multi::IRC: Don't listen to unaddressed commands without the ! trigger
Tiny bug introduced in a recent commit.
-rw-r--r--lib/Multi/IRC.pm4
1 files changed, 2 insertions, 2 deletions
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);