From 4696df7ea11e01858859e3ff9052e22db3e1afa1 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 31 May 2014 01:07:29 +0000 Subject: [PATCH] Add subroutines to release and identify nick if necessary --- PBot/IRCHandlers.pm | 18 ++++++++++++++++++ PBot/VERSION.pm | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/PBot/IRCHandlers.pm b/PBot/IRCHandlers.pm index 731e135c..167498a6 100644 --- a/PBot/IRCHandlers.pm +++ b/PBot/IRCHandlers.pm @@ -244,6 +244,24 @@ sub on_departure { } } +sub on_notregistered { + my ($self, $conn, $event) = @_; + my ($addr, $msg) = $event->args; + + $self->{pbot}->{logger}->log("Received NOTREGISTERED from $addr: $msg\n"); + $conn->privmsg("nickserv", "release " . $self->{pbot}->{registry}->get_value('irc', 'botnick') . ' ' . $self->{pbot}->{registry}->get_value('irc', 'identify_password')); + $conn->privmsg("nickserv", "identify " . $self->{pbot}->{registry}->get_value('irc', 'botnick') . ' ' . $self->{pbot}->{registry}->get_value('irc', 'identify_password')); +} + +sub on_bannickchange { + my ($self, $conn, $event) = @_; + my ($addr, $nick, $msg) = $event->args; + + $self->{pbot}->{logger}->log("Received BANNICKCHANGE from $addr: $nick ($msg)\n"); + $conn->privmsg("nickserv", "release " . $self->{pbot}->{registry}->get_value('irc', 'botnick') . ' ' . $self->{pbot}->{registry}->get_value('irc', 'identify_password')); + $conn->privmsg("nickserv", "identify " . $self->{pbot}->{registry}->get_value('irc', 'botnick') . ' ' . $self->{pbot}->{registry}->get_value('irc', 'identify_password')); +} + sub on_nickchange { my ($self, $conn, $event) = @_; my ($nick, $user, $host, $newnick) = ($event->nick, $event->user, $event->host, $event->args); diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 55f7518d..9ddc4efe 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 605, + BUILD_REVISION => 606, BUILD_DATE => "2014-05-30", };