diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 70b6a95e..00352e62 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -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"); diff --git a/PBot/IRCHandlers.pm b/PBot/IRCHandlers.pm index afa2d282..7d45d2b9 100644 --- a/PBot/IRCHandlers.pm +++ b/PBot/IRCHandlers.pm @@ -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"); diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index c6dddf66..564b24e9 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -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;