From cd665619ee86735d10fa5a2b9a9aa0e8672d1832 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 29 May 2020 18:19:42 -0700 Subject: [PATCH] AntiFlood: devoice +v users when banning --- PBot/AntiFlood.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 82d35ea3..2c2ed8c3 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -525,7 +525,8 @@ sub check_flood { } if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+v')) { - $self->{pbot}->{chanops}->add_op_command($chan, 'mode -v $nick'); + $self->{pbot}->{chanops}->add_op_command($chan, "mode $chan -v $nick"); + $self->{pbot}->{chanops}->gain_ops($chan); } $self->{pbot}->{banlist}->ban_user_timed( @@ -580,7 +581,8 @@ sub check_flood { } if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+v')) { - $self->{pbot}->{chanops}->add_op_command($chan, 'mode -v $nick'); + $self->{pbot}->{chanops}->add_op_command($chan, "mode $chan -v $nick"); + $self->{pbot}->{chanops}->gain_ops($chan); } $self->{pbot}->{banlist}->ban_user_timed( @@ -629,7 +631,8 @@ sub check_flood { } if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+v')) { - $self->{pbot}->{chanops}->add_op_command($chan, 'mode -v $nick'); + $self->{pbot}->{chanops}->add_op_command($chan, "mode $chan -v $nick"); + $self->{pbot}->{chanops}->gain_ops($chan); } if ($self->{pbot}->{banlist}->has_ban_timeout($chan, "*!$user\@" . $self->address_to_mask($host))) {