mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 12:32:37 +01:00
Paste remaining lines to paste site if truncated with more lines remaining when preserve newlines is in effect
This commit is contained in:
parent
a8ffedc853
commit
dddc9c3be9
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user