mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-16 21:40:46 +01:00
Factoids: disable nickprefixing when action contains $args at any recursion level
This commit is contained in:
parent
d12a463987
commit
9f46cf0ebc
@ -342,14 +342,14 @@ sub handle_action {
|
|||||||
|
|
||||||
$context->{arguments} = '';
|
$context->{arguments} = '';
|
||||||
$context->{original_arguments} = '';
|
$context->{original_arguments} = '';
|
||||||
|
$context->{nickprefix_disabled} = 1;
|
||||||
} else {
|
} else {
|
||||||
# set nickprefix if args is a present nick and factoid action doesn't have $nick or $args
|
# 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') {
|
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});
|
my $target = $self->{pbot}->{nicklist}->is_present_similar($context->{from}, $context->{arguments});
|
||||||
|
|
||||||
if ($target and $action !~ /\$\{?(?:nick|args)\b/) {
|
if ($target and $action !~ /\$\{?(?:nick|args)\b/) {
|
||||||
$context->{nickprefix} = $target unless $context->{nickprefix_forced};
|
$context->{nickprefix} = $target unless $context->{nickprefix_forced};
|
||||||
$context->{nickprefix_disabled} = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4556,
|
BUILD_REVISION => 4557,
|
||||||
BUILD_DATE => "2022-07-09",
|
BUILD_DATE => "2022-07-09",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user