From dddc9c3be9edb6c2d7ccbe8cad57b559285177d2 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Tue, 5 Aug 2014 23:11:51 +0000 Subject: [PATCH] Paste remaining lines to paste site if truncated with more lines remaining when preserve newlines is in effect --- PBot/Interpreter.pm | 6 ++++-- PBot/VERSION.pm | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PBot/Interpreter.pm b/PBot/Interpreter.pm index 5705461c..a271ae00 100644 --- a/PBot/Interpreter.pm +++ b/PBot/Interpreter.pm @@ -160,12 +160,14 @@ sub handle_result { my $preserve_newlines = $self->{pbot}->{registry}->get_value($from, 'preserve_newlines'); $result =~ s/[\n\r]/ /g unless $preserve_newlines; - $result =~ s/\s+/ /g unless $preserve_whitespace; + $result =~ s/[ \t]+/ /g unless $preserve_whitespace; my $lines = 0; foreach my $line (split /[\n\r]/, $result) { if (++$lines >= 4) { - $pbot->{conn}->privmsg($from, "And that's all I have to say about that."); + my $link = paste_sprunge("[" . (defined $from ? $from : "stdin") . "] <$nick> $text\n\n$original_result"); + $line = "And that's all I have to say about that. See $link for full text."; + $pbot->{conn}->privmsg($from, $line); last; } diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index a94d41da..46e5059e 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 768, - BUILD_DATE => "2014-08-04", + BUILD_REVISION => 769, + BUILD_DATE => "2014-08-05", }; 1;