mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-01 23:14:09 +01:00
Improve output of truncation text
Instead of "... [truncated; see http://xxx for full text.]" it more concisely says "... <truncated; http://...>". Increased irc.max_msg_len from a very conservative 425 to a more generous 460. If you have very long channel names or nicknames, or if you see things being truncated incorrectly, reduce this value.
This commit is contained in:
parent
91073df113
commit
d1df2d325c
2
data/registry
vendored
2
data/registry
vendored
@ -284,7 +284,7 @@
|
||||
},
|
||||
"max_msg_len" : {
|
||||
"type" : "text",
|
||||
"value" : "425"
|
||||
"value" : "460"
|
||||
},
|
||||
"port" : {
|
||||
"type" : "text",
|
||||
|
@ -770,17 +770,17 @@ sub truncate_result {
|
||||
$paste_result = $self->{pbot}->{webpaste}->paste("$context->{from} <$context->{nick}> $context->{text}\n\n$paste_text");
|
||||
}
|
||||
|
||||
my $trunc = '... [truncated';
|
||||
my $trunc = '... <truncated';
|
||||
|
||||
if (not defined $paste_result) {
|
||||
# no paste
|
||||
$trunc .= "]";
|
||||
$trunc .= '>';
|
||||
} elsif ($paste_result =~ m/^http/) {
|
||||
# a link
|
||||
$trunc .= "; see $paste_result for full text.]";
|
||||
$trunc .= "; $paste_result>";
|
||||
} else {
|
||||
# an error or something else
|
||||
$trunc .= "; $paste_result]";
|
||||
$trunc .= "; $paste_result>";
|
||||
}
|
||||
|
||||
$paste_result //= 'not pasted';
|
||||
|
@ -48,7 +48,7 @@ sub initialize {
|
||||
# irc
|
||||
$self->add_default('text', 'irc', 'debug', $conf{irc_debug} // 0);
|
||||
$self->add_default('text', 'irc', 'show_motd', $conf{show_motd} // 1);
|
||||
$self->add_default('text', 'irc', 'max_msg_len', $conf{max_msg_len} // 425);
|
||||
$self->add_default('text', 'irc', 'max_msg_len', $conf{max_msg_len} // 460);
|
||||
$self->add_default('text', 'irc', 'server', $conf{server} // "irc.libera.chat");
|
||||
$self->add_default('text', 'irc', 'port', $conf{port} // 6667);
|
||||
$self->add_default('text', 'irc', 'sasl', $conf{SASL} // 0);
|
||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4349,
|
||||
BUILD_DATE => "2021-08-06",
|
||||
BUILD_REVISION => 4352,
|
||||
BUILD_DATE => "2021-08-12",
|
||||
};
|
||||
|
||||
sub initialize {}
|
||||
|
Loading…
Reference in New Issue
Block a user