diff --git a/lib/PBot/Core/AntiFlood.pm b/lib/PBot/Core/AntiFlood.pm index 73513ca3..648ab93c 100644 --- a/lib/PBot/Core/AntiFlood.pm +++ b/lib/PBot/Core/AntiFlood.pm @@ -154,7 +154,8 @@ sub check_flood { $self->{pbot}->{logger}->log("[MSG] $channel ($account) $mask => $text\n"); } else { my $from = $channel eq lc $mask ? undef : $channel; - my ($type) = $text =~ /^(\w+) /; + $text =~ s/^(\w+) //; + my $type = $1; $self->{pbot}->{logger}->log("[$type] " . (defined $from ? "$from " : '') . "($account) $mask => $text\n"); } } diff --git a/lib/PBot/Core/Handlers/Server.pm b/lib/PBot/Core/Handlers/Server.pm index 4c7c4fda..79397697 100644 --- a/lib/PBot/Core/Handlers/Server.pm +++ b/lib/PBot/Core/Handlers/Server.pm @@ -203,7 +203,13 @@ sub on_chghost { $self->{pbot}->{logger}->log("[CHGHOST] ($account) $nick!$user\@$host changed host to ($id) $nick!$newuser\@$newhost\n"); - return 1; + my $channels = $self->{pbot}->{nicklist}->get_channels($nick); + + foreach my $channel (@$channels) { + $self->{pbot}->{antiflood}->check_bans($id, "$nick!$newuser\@$newhost", $channel); + } + + return 1; } sub log_first_arg { diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 72249e2c..a78b513e 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4615, + BUILD_REVISION => 4616, BUILD_DATE => "2023-02-02", };