3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

Fix ban list type flag inconsistency due to BanList refactor

This commit is contained in:
Pragmatic Software 2020-04-30 14:27:10 -07:00
parent 54971a6051
commit e071005cd4
3 changed files with 6 additions and 6 deletions

View File

@ -598,7 +598,7 @@ sub unbanme {
$self->{pbot}->{logger}->log("anti-flood: [unbanme] $anick!$auser\@$ahost banned as $baninfo->{mask} in $baninfo->{channel}, but allowed through whitelist\n");
} else {
if ($channel eq lc $baninfo->{channel}) {
my $mode = $baninfo->{type} eq "+b" ? "banned" : "quieted";
my $mode = $baninfo->{type} eq 'b' ? "banned" : "quieted";
$self->{pbot}->{logger}->log("anti-flood: [unbanme] $anick!$auser\@$ahost $mode as $baninfo->{mask} in $baninfo->{channel} by $baninfo->{owner}, unbanme rejected\n");
return "/msg $nick You have been $mode as $baninfo->{mask} by $baninfo->{owner}, unbanme will not work until it is removed.";
}
@ -853,7 +853,7 @@ sub check_bans {
next;
}
if (defined $nickserv and $baninfo->{type} eq '+q' and $baninfo->{mask} =~ /^\$a:(.*)/ and lc $1 eq $nickserv and $nickserv eq $current_nickserv_account) {
if (defined $nickserv and $baninfo->{type} eq 'q' and $baninfo->{mask} =~ /^\$a:(.*)/ and lc $1 eq $nickserv and $nickserv eq $current_nickserv_account) {
$self->{pbot}->{logger}->log("anti-flood: [check-bans] Hostmask ($mask) matches quiet on account ($nickserv), disregarding\n");
next;
}

View File

@ -386,11 +386,11 @@ sub unmode_user {
my %unbanned;
if (not defined $bans) {
push @$bans, { mask => $mask, type => "+$mode" };
push @$bans, { mask => $mask, type => $mode };
}
foreach my $ban (@$bans) {
next if $ban->{type} ne "+$mode";
next if $ban->{type} ne $mode;
next if exists $unbanned{$ban->{mask}};
$unbanned{$ban->{mask}} = 1;
$self->add_to_unban_queue($channel, $mode, $ban->{mask});
@ -742,7 +742,7 @@ sub is_banned {
$self->{pbot}->{logger}->log("[BanList] is_banned: $nick!$user\@$host banned as $baninfo->{mask} in $baninfo->{channel}, but allowed through whitelist\n");
} else {
if ($channel eq lc $baninfo->{channel}) {
my $mode = $baninfo->{type} eq "+b" ? "banned" : "quieted";
my $mode = $baninfo->{type} eq 'b' ? "banned" : "quieted";
$self->{pbot}->{logger}->log("[BanList] is_banned: $nick!$user\@$host $mode as $baninfo->{mask} in $baninfo->{channel} by $baninfo->{owner}\n");
$banned = $baninfo;
last;

View File

@ -454,7 +454,7 @@ sub unban_user {
last;
}
} else {
$self->{pbot}->{banlist}->unban_user($t, 'b', $channel, $immediately);
$self->{pbot}->{banlist}->unban_user($channel, 'b', $t, $immediately);
}
}