From 4f54ee669cc69f1166fbb5c4431281d1c34bfc7e Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 21 May 2018 18:06:32 -0700 Subject: [PATCH] Do not do me/my expansion for a few more commands --- PBot/Interpreter.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PBot/Interpreter.pm b/PBot/Interpreter.pm index a9b83f8d..6b038750 100644 --- a/PBot/Interpreter.pm +++ b/PBot/Interpreter.pm @@ -298,7 +298,7 @@ sub interpret { $stuff->{nickoverride} = $stuff->{nick} if defined $stuff->{nickoverride} and lc $stuff->{nickoverride} eq 'me'; - if ($keyword !~ /^(?:factrem|forget|set|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl|spinach|choose|c|lie|l|adminadd)$/) { + if ($keyword !~ /^(?:factrem|forget|set|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl|ban|mute|spinach|choose|c|lie|l|adminadd|unmute|unban)$/) { $keyword =~ s/(\w+)([?!.]+)$/$1/; $arguments =~ s/(?{nick} is/gi if defined $arguments && $stuff->{interpret_depth} <= 2; $arguments =~ s/(?{nick}/gi if defined $arguments && $stuff->{interpret_depth} <= 2; @@ -514,16 +514,17 @@ sub output_result { return if not defined $line or not length $line; if ($line =~ s/^\/say\s+//i) { - if (defined $stuff->{nickoverride} and ($stuff->{no_nickoverride} == 0 or $stuff->{force_nickoverride} == 1)) { $line = "$stuff->{nickoverride}: $line"; } $pbot->{conn}->privmsg($stuff->{from}, $line) if defined $stuff->{from} && $stuff->{from} !~ /\Q$botnick\E/i; $pbot->{antiflood}->check_flood($stuff->{from}, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', $line, 0, 0, 0) if $stuff->{checkflood}; } elsif ($line =~ s/^\/me\s+//i) { +=cut if (defined $stuff->{nickoverride}) { $line = "$line (for $stuff->{nickoverride})"; } +=cut $pbot->{conn}->me($stuff->{from}, $line) if defined $stuff->{from} && $stuff->{from} !~ /\Q$botnick\E/i; $pbot->{antiflood}->check_flood($stuff->{from}, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', '/me ' . $line, 0, 0, 0) if $stuff->{checkflood}; } elsif ($line =~ s/^\/msg\s+([^\s]+)\s+//i) { @@ -533,9 +534,11 @@ sub output_result { } elsif ($to =~ /.*serv(?:@.*)?$/i) { $pbot->{logger}->log("[HACK] Possible HACK ATTEMPT /msg *serv: [$stuff->{nick}!$stuff->{user}\@$stuff->{host}] [$stuff->{command}] [$line]\n"); } elsif ($line =~ s/^\/me\s+//i) { +=cut if (defined $stuff->{nickoverride}) { $line = "$line (for $stuff->{nickoverride})"; } +=cut $pbot->{conn}->me($to, $line) if $to !~ /\Q$botnick\E/i; $pbot->{antiflood}->check_flood($to, $botnick, $pbot->{registry}->get_value('irc', 'username'), 'localhost', '/me ' . $line, 0, 0, 0) if $stuff->{checkflood}; } else {