Paste remaining lines to paste site if truncated with more lines remaining when preserve newlines is in effect

This commit is contained in:
Pragmatic Software 2014-08-05 23:11:51 +00:00
parent a8ffedc853
commit dddc9c3be9
2 changed files with 6 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;