diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index ebc1119e..a91c696b 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -478,11 +478,15 @@ sub interpreter { $result =~ s/\\\$/\$/g; - if($result =~ s/^\/say\s+/$ref_from/i || $result =~ s/^\/me\s+(.*)/\/me $1 $ref_from/i - || $result =~ s/^\/msg\s+([^ ]+)/\/msg $1 $ref_from/i) { + if($ref_from) { + if($result =~ s/^\/say\s+/$ref_from/i || $result =~ s/^\/me\s+(.*)/\/me $1 $ref_from/i + || $result =~ s/^\/msg\s+([^ ]+)/\/msg $1 $ref_from/i) { + return $result; + } else { + return $ref_from . "$keyword is $result"; + } + }else { return $result; - } else { - return $ref_from . "$keyword is $result"; } } elsif($self->factoids->hash->{$channel}->{$keyword}->{type} eq 'regex') { $result = eval { diff --git a/PBot/Interpreter.pm b/PBot/Interpreter.pm index eb0a6099..6485f180 100644 --- a/PBot/Interpreter.pm +++ b/PBot/Interpreter.pm @@ -168,11 +168,16 @@ sub process_line { $pbot->logger->log("Final result: $result\n"); - if($result =~ s/^\/me\s+//i) { + if($result =~ s/^\/say\s+//i) { + $pbot->conn->privmsg($from, $result) if defined $from && $from !~ /\Q$mynick\E/i; + } elsif($result =~ s/^\/me\s+//i) { $pbot->conn->me($from, $result) if defined $from && $from !~ /\Q$mynick\E/i; } elsif($result =~ s/^\/msg\s+([^\s]+)\s+//i) { my $to = $1; - if($to =~ /.*serv$/i) { + if($to =~ /,/) { + $pbot->logger->log("[HACK] Possible HACK ATTEMPT /msg multiple users: [$nick!$user\@$host] [$command] [$result]\n"); + } + elsif($to =~ /.*serv$/i) { $pbot->logger->log("[HACK] Possible HACK ATTEMPT /msg *serv: [$nick!$user\@$host] [$command] [$result]\n"); } elsif($result =~ s/^\/me\s+//i) { diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 99cd71c9..36104768 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 445, + BUILD_REVISION => 446, BUILD_DATE => "2013-10-12", };