3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 05:49:27 +01:00

Factoids: disable nickprefixing when action contains $args at any recursion level

This commit is contained in:
Pragmatic Software 2022-07-09 19:33:43 -07:00
parent d12a463987
commit 9f46cf0ebc
2 changed files with 3 additions and 3 deletions

View File

@ -342,14 +342,14 @@ sub handle_action {
$context->{arguments} = '';
$context->{original_arguments} = '';
$context->{nickprefix_disabled} = 1;
} else {
# set nickprefix if args is a present nick and factoid action doesn't have $nick or $args
if (!$context->{nickprefix_disabled} && $self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $keyword, 'type') eq 'text') {
my $target = $self->{pbot}->{nicklist}->is_present_similar($context->{from}, $context->{arguments});
if ($target and $action !~ /\$\{?(?:nick|args)\b/) {
$context->{nickprefix} = $target unless $context->{nickprefix_forced};
$context->{nickprefix_disabled} = 0;
$context->{nickprefix} = $target unless $context->{nickprefix_forced};
}
}
}

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 => 4556,
BUILD_REVISION => 4557,
BUILD_DATE => "2022-07-09",
};