3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-19 10:29:30 +01:00

Factoids: do not prefix nick if action has $args

This commit is contained in:
Pragmatic Software 2022-07-08 09:11:16 -07:00
parent a170b28a8b
commit 833c20efbb

View File

@ -343,11 +343,11 @@ sub handle_action {
$context->{arguments} = ''; $context->{arguments} = '';
$context->{original_arguments} = ''; $context->{original_arguments} = '';
} else { } else {
# set nickprefix if args is a present nick and factoid action doesn't have $nick # set nickprefix if args is a present nick and factoid action doesn't have $nick or $args
if ($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\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; $context->{nickprefix_disabled} = 0;
} }