mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +01:00
IRC: wait for NickServ NOTICE before identifying
This commit is contained in:
parent
9c17b4bc5a
commit
b07306f530
@ -61,7 +61,7 @@ sub get_flood_account {
|
||||
foreach my $mask (keys %{ $self->message_history }) {
|
||||
|
||||
# check if foo!bar@baz matches foo!*@*; e.g., same nick, but possibly different user@host
|
||||
# (usually logging into nickserv, but could possibly be attempted nick hijacking)
|
||||
# (usually logging into nickserv or a dynamic ip address, but could possibly be attempted nick hijacking)
|
||||
|
||||
if($mask =~ m/^\Q$nick\E!.*/i) {
|
||||
$self->{pbot}->logger->log("anti-flood: [get-account] $nick!$user\@$host seen previously as $mask\n");
|
||||
|
@ -40,8 +40,7 @@ sub initialize {
|
||||
|
||||
sub on_connect {
|
||||
my ($self, $conn) = @_;
|
||||
$self->{pbot}->logger->log("Connected! Identifying with NickServ . . .\n");
|
||||
$conn->privmsg("nickserv", "identify " . $self->pbot->identify_password);
|
||||
$self->{pbot}->logger->log("Connected!\n");
|
||||
$conn->{connected} = 1;
|
||||
}
|
||||
|
||||
@ -92,7 +91,12 @@ sub on_notice {
|
||||
|
||||
$self->{pbot}->logger->log("Received NOTICE from $nick $host '$text'\n");
|
||||
|
||||
if($nick eq "NickServ" && $text =~ m/You are now identified/i) {
|
||||
if($nick eq "NickServ" && $text =~ m/This nickname is registered/) {
|
||||
$self->{pbot}->logger->log("Identifying with NickServ . . .\n");
|
||||
$conn->privmsg("nickserv", "identify " . $self->pbot->identify_password);
|
||||
}
|
||||
|
||||
if($nick eq "NickServ" && $text =~ m/You are now identified/) {
|
||||
foreach my $chan (keys %{ $self->{pbot}->channels->channels->hash }) {
|
||||
if($self->{pbot}->channels->channels->hash->{$chan}{enabled}) {
|
||||
$self->{pbot}->logger->log("Joining channel: $chan\n");
|
||||
|
@ -13,8 +13,8 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 309,
|
||||
BUILD_DATE => "2011-02-10",
|
||||
BUILD_REVISION => 310,
|
||||
BUILD_DATE => "2011-02-11",
|
||||
};
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user