Enforce nick-change flood on Guest nicks

This commit is contained in:
Pragmatic Software 2015-08-08 12:40:06 -07:00
parent 499d91e07d
commit 260b1405a7
1 changed files with 4 additions and 8 deletions

View File

@ -192,14 +192,10 @@ sub check_flood {
$self->{pbot}->{logger}->log(sprintf("%-18s | %-65s | %s\n", "NICKCHANGE", $mask, $text));
my ($newnick) = $text =~ m/NICKCHANGE (.*)/;
if($newnick =~ m/^Guest\d+$/) {
# Don't enforce for services-mandated change to guest account
} else {
$mask = "$newnick!$user\@$host";
$account = $self->{pbot}->{messagehistory}->get_message_account($newnick, $user, $host);
$nick = $newnick;
$self->{nickflood}->{$account}->{changes}++;
}
$mask = "$newnick!$user\@$host";
$account = $self->{pbot}->{messagehistory}->get_message_account($newnick, $user, $host);
$nick = $newnick;
$self->{nickflood}->{$account}->{changes}++;
} else {
$self->{pbot}->{logger}->log(sprintf("%-18s | %-65s | %s\n", lc $channel eq lc $mask ? "QUIT" : $channel, $mask, $text));
}