mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-29 23:39:24 +01:00
AntiFlood: check for +v/+o on user when enforcing anti-flood
This commit is contained in:
parent
85e08eee9e
commit
f8b6cee54e
@ -519,6 +519,15 @@ sub check_flood {
|
|||||||
if ($self->{pbot}->{registry}->get_value('antiflood', 'enforce')) {
|
if ($self->{pbot}->{registry}->get_value('antiflood', 'enforce')) {
|
||||||
my $length = $self->{pbot}->{registry}->get_array_value('antiflood', 'chat_flood_punishment', $chan_data->{offenses} - 1);
|
my $length = $self->{pbot}->{registry}->get_array_value('antiflood', 'chat_flood_punishment', $chan_data->{offenses} - 1);
|
||||||
|
|
||||||
|
if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+o')) {
|
||||||
|
$self->{pbot}->{logger}->log("Disregarding flood enforcement for opped user $nick in $chan.\n");
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+v')) {
|
||||||
|
$self->{pbot}->{chanops}->add_op_command($chan, 'mode -v $nick');
|
||||||
|
}
|
||||||
|
|
||||||
$self->{pbot}->{banlist}->ban_user_timed(
|
$self->{pbot}->{banlist}->ban_user_timed(
|
||||||
$chan,
|
$chan,
|
||||||
'b',
|
'b',
|
||||||
@ -565,6 +574,15 @@ sub check_flood {
|
|||||||
if ($self->{pbot}->{registry}->get_value('antiflood', 'enforce')) {
|
if ($self->{pbot}->{registry}->get_value('antiflood', 'enforce')) {
|
||||||
my $length = $self->{pbot}->{registry}->get_array_value('antiflood', 'nick_flood_punishment', $self->{nickflood}->{$ancestor}->{offenses} - 1);
|
my $length = $self->{pbot}->{registry}->get_array_value('antiflood', 'nick_flood_punishment', $self->{nickflood}->{$ancestor}->{offenses} - 1);
|
||||||
|
|
||||||
|
if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+o')) {
|
||||||
|
$self->{pbot}->{logger}->log("Disregarding flood enforcement for opped user $nick in $chan.\n");
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+v')) {
|
||||||
|
$self->{pbot}->{chanops}->add_op_command($chan, 'mode -v $nick');
|
||||||
|
}
|
||||||
|
|
||||||
$self->{pbot}->{banlist}->ban_user_timed(
|
$self->{pbot}->{banlist}->ban_user_timed(
|
||||||
$chan,
|
$chan,
|
||||||
'b',
|
'b',
|
||||||
@ -605,6 +623,15 @@ sub check_flood {
|
|||||||
$chan_data->{enter_abuses}++;
|
$chan_data->{enter_abuses}++;
|
||||||
if ($chan_data->{enter_abuses} >= $enter_abuse_max_offenses) {
|
if ($chan_data->{enter_abuses} >= $enter_abuse_max_offenses) {
|
||||||
if ($self->{pbot}->{registry}->get_value('antiflood', 'enforce')) {
|
if ($self->{pbot}->{registry}->get_value('antiflood', 'enforce')) {
|
||||||
|
if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+o')) {
|
||||||
|
$self->{pbot}->{logger}->log("Disregarding flood enforcement for opped user $nick in $chan.\n");
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{pbot}->{nicklist}->get_meta($chan, $nick, '+v')) {
|
||||||
|
$self->{pbot}->{chanops}->add_op_command($chan, 'mode -v $nick');
|
||||||
|
}
|
||||||
|
|
||||||
if ($self->{pbot}->{banlist}->has_ban_timeout($chan, "*!$user\@" . $self->address_to_mask($host))) {
|
if ($self->{pbot}->{banlist}->has_ban_timeout($chan, "*!$user\@" . $self->address_to_mask($host))) {
|
||||||
$self->{pbot}->{logger}->log("$nick $chan enter abuse offense disregarded due to existing ban\n");
|
$self->{pbot}->{logger}->log("$nick $chan enter abuse offense disregarded due to existing ban\n");
|
||||||
next;
|
next;
|
||||||
@ -911,12 +938,14 @@ sub check_bans {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($baninfo->{type} eq 'blacklist') { $self->{pbot}->{chanops}->add_op_command($baninfo->{channel}, "kick $baninfo->{channel} $bannick I don't think so"); }
|
if ($baninfo->{type} eq 'blacklist') {
|
||||||
else {
|
$self->{pbot}->{chanops}->add_op_command($baninfo->{channel}, "kick $baninfo->{channel} $bannick I don't think so");
|
||||||
|
} else {
|
||||||
my $owner = $baninfo->{owner};
|
my $owner = $baninfo->{owner};
|
||||||
$owner =~ s/!.*$//;
|
$owner =~ s/!.*$//;
|
||||||
$self->{pbot}->{chanops}->add_op_command($baninfo->{channel}, "kick $baninfo->{channel} $bannick Evaded $baninfo->{mask} set by $owner");
|
$self->{pbot}->{chanops}->add_op_command($baninfo->{channel}, "kick $baninfo->{channel} $bannick Evaded $baninfo->{mask} set by $owner");
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{pbot}->{banlist}->ban_user_timed(
|
$self->{pbot}->{banlist}->ban_user_timed(
|
||||||
$baninfo->{channel},
|
$baninfo->{channel},
|
||||||
'b',
|
'b',
|
||||||
|
Loading…
Reference in New Issue
Block a user