3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-23 04:19:27 +01:00

Implement antiflood.join_flood_channel registry entry

This commit is contained in:
Pragmatic Software 2021-06-17 09:58:42 -07:00
parent 7fce39a349
commit 9b114006e0
2 changed files with 9 additions and 4 deletions

View File

@ -128,9 +128,11 @@ sub cmd_unbanme {
next if $aliases{$alias}->{type} == $self->{pbot}->{messagehistory}->{database}->{alias_type}->{WEAK};
next if $aliases{$alias}->{nickchange} == 1;
my $join_flood_channel = $self->{pbot}->{registry}->get_value('antiflood', 'join_flood_channel') // '#stop-join-flood';
my ($anick, $auser, $ahost) = $alias =~ m/([^!]+)!([^@]+)@(.*)/;
my $banmask = $self->address_to_mask($ahost);
my $mask = "*!$auser\@$banmask\$##stop_join_flood";
my $mask = "*!$auser\@$banmask\$$join_flood_channel";
my @channels = $self->{pbot}->{messagehistory}->{database}->get_channels($aliases{$alias}->{id});
@ -483,11 +485,13 @@ sub check_flood {
my $duration = duration($timeout);
my $banmask = $self->address_to_mask($host);
my $join_flood_channel = $self->{pbot}->{registry}->get_value('antiflood', 'join_flood_channel') // '#stop-join-flood';
if ($self->{pbot}->{channels}->is_active_op("${channel}-floodbans")) {
$self->{pbot}->{banlist}->ban_user_timed(
$chan . '-floodbans',
'b',
"*!$user\@$banmask\$##stop_join_flood",
"*!$user\@$banmask\$$join_flood_channel",
$timeout,
$self->{pbot}->{registry}->get_value('irc', 'botnick'),
'join flooding',

View File

@ -303,8 +303,9 @@ sub track_mode {
$self->{pbot}->{timer}->dequeue_event("unban $channel $mask");
# freenode strips channel forwards from unban result if no ban exists with a channel forward
$self->{banlist}->remove($channel, "$mask\$##stop_join_flood");
$self->{pbot}->{timer}->dequeue_event(lc "unban $channel $mask\$##stop_join_flood");
my $join_flood_channel = $self->{pbot}->{registry}->get_value('antiflood', 'join_flood_channel') // '#stop-join-flood';
$self->{banlist}->remove($channel, "$mask\$$join_flood_channel");
$self->{pbot}->{timer}->dequeue_event(lc "unban $channel $mask\$$join_flood_channel");
} elsif ($mode eq "-$mute_char") {
$self->{quietlist}->remove($channel, $mask);
$self->{pbot}->{timer}->dequeue_event("unmute $channel $mask");