3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Factoids: preserve_whitespace now works for all factoids

This commit is contained in:
Pragmatic Software 2021-08-23 19:27:34 -07:00
parent ebb209549a
commit 48373719d8
2 changed files with 9 additions and 7 deletions

View File

@ -426,15 +426,17 @@ sub handle_action {
}
}
my $preserve_whitespace = $self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'preserve_whitespace');
if (defined $preserve_whitespace) {
$context->{preserve_whitespace} = $preserve_whitespace;
}
return $action if $context->{special} eq 'code-factoid';
if ($self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'type') eq 'module') {
my $preserve_whitespace = $self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'preserve_whitespace');
$preserve_whitespace = 0 if not defined $preserve_whitespace;
$context->{preserve_whitespace} = $preserve_whitespace;
$context->{root_keyword} = $keyword unless defined $context->{root_keyword};
$context->{root_channel} = $channel;
$context->{root_keyword} = $keyword unless defined $context->{root_keyword};
$context->{root_channel} = $channel;
my $result = $self->{pbot}->{modules}->execute_module($context);

View File

@ -25,7 +25,7 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4361,
BUILD_REVISION => 4362,
BUILD_DATE => "2021-08-23",
};