mirror of
https://github.com/pragma-/pbot.git
synced 2025-04-26 09:47:53 +02:00
Don't enforce nick anti-flood for services-mandated changes to Guest nick
This commit is contained in:
parent
591dbd70ab
commit
a7681c36cb
@ -365,6 +365,14 @@ sub check_flood {
|
|||||||
$self->{pbot}->conn->privmsg($nick, "You have used too many commands in too short a time period, you have been ignored for $length.");
|
$self->{pbot}->conn->privmsg($nick, "You have used too many commands in too short a time period, you have been ignored for $length.");
|
||||||
}
|
}
|
||||||
} elsif($mode == $self->{pbot}->{messagehistory}->{MSG_NICKCHANGE} and $self->{nickflood}->{$account}->{changes} >= $max_messages) {
|
} elsif($mode == $self->{pbot}->{messagehistory}->{MSG_NICKCHANGE} and $self->{nickflood}->{$account}->{changes} >= $max_messages) {
|
||||||
|
($nick) = $text =~ m/NICKCHANGE (.*)/;
|
||||||
|
|
||||||
|
if($nick =~ m/^Guest\d+$/) {
|
||||||
|
# Don't enforce for services-mandated change to guest account
|
||||||
|
$self->{nickflood}->{$account}->{changes}--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$self->{nickflood}->{$account}->{offenses}++;
|
$self->{nickflood}->{$account}->{offenses}++;
|
||||||
$self->{nickflood}->{$account}->{changes} = $max_messages - 2; # allow 1 more change (to go back to original nick)
|
$self->{nickflood}->{$account}->{changes} = $max_messages - 2; # allow 1 more change (to go back to original nick)
|
||||||
$self->{nickflood}->{$account}->{timestamp} = gettimeofday;
|
$self->{nickflood}->{$account}->{timestamp} = gettimeofday;
|
||||||
@ -376,7 +384,6 @@ sub check_flood {
|
|||||||
$self->{pbot}->chanops->ban_user_timed("*!$user\@$host", $chan, $length);
|
$self->{pbot}->chanops->ban_user_timed("*!$user\@$host", $chan, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
($nick) = $text =~ m/NICKCHANGE (.*)/;
|
|
||||||
$length = duration($length);
|
$length = duration($length);
|
||||||
$self->{pbot}->logger->log("$nick nickchange flood offense " . $self->{nickflood}->{$account}->{offenses} . " earned $length ban\n");
|
$self->{pbot}->logger->log("$nick nickchange flood offense " . $self->{nickflood}->{$account}->{offenses} . " earned $length ban\n");
|
||||||
$self->{pbot}->conn->privmsg($nick, "You have been temporarily banned due to nick-change flooding. You will be unbanned in $length.");
|
$self->{pbot}->conn->privmsg($nick, "You have been temporarily banned due to nick-change flooding. You will be unbanned in $length.");
|
||||||
|
@ -13,7 +13,7 @@ use warnings;
|
|||||||
# These are set automatically by the build/commit script
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 577,
|
BUILD_REVISION => 578,
|
||||||
BUILD_DATE => "2014-05-15",
|
BUILD_DATE => "2014-05-15",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user