diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index f3b84d8c..507dc55c 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -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', diff --git a/PBot/BanList.pm b/PBot/BanList.pm index 2b2b4c81..5e0abad2 100644 --- a/PBot/BanList.pm +++ b/PBot/BanList.pm @@ -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");