diff --git a/lib/PBot/Core/Interpreter.pm b/lib/PBot/Core/Interpreter.pm index f078f504..6d8d43a4 100644 --- a/lib/PBot/Core/Interpreter.pm +++ b/lib/PBot/Core/Interpreter.pm @@ -691,6 +691,8 @@ sub handle_result { my $original_result = $result; + $context->{original_result} = $result; + $result =~ s/[\n\r]/ /g unless $preserve_newlines; $result =~ s/[ \t]+/ /g unless $context->{preserve_whitespace}; @@ -730,13 +732,6 @@ sub handle_result { last; } - # insert null-width spaces into nicknames to prevent IRC clients - # from unncessarily highlighting people - $line = $self->dehighlight_nicks($line, $context->{from}); - - # truncate if necessary, pasting original result to a web paste site - $line = $self->truncate_result($context, $line, $original_result); - if ($use_output_queue) { my $delay = rand(10) + 5; my $message = { @@ -880,6 +875,13 @@ sub output_result { # nothing more to do here if the output is going to the bot return if $to eq $botnick; + # insert null-width spaces into nicknames to prevent IRC clients + # from unncessarily highlighting people + $output = $self->dehighlight_nicks($output, $to) unless $output =~ m|^/msg |; + + # truncate if necessary, pasting original result to a web paste site + $output = $self->truncate_result($context, $output, $context->{original_result}); + # handle various /command prefixes my $type = 'echo'; # will be set to 'echo' or 'action' depending on /command prefix diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 91438889..d61494f1 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,8 +25,8 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4366, - BUILD_DATE => "2021-08-24", + BUILD_REVISION => 4367, + BUILD_DATE => "2021-08-25", }; sub initialize {}