summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker2016-04-06 16:03:28 +0100
committerDagfinn Ilmari Mannsåker2016-04-20 19:03:09 +0100
commiteb763cd5810dfce73989c0ef54d91ce0018449a5 (patch)
tree42afee86375b120bca2d4ef93d2b58a38979191e /scripts
parentc4c7095de605ae49a89a4cff238817f4e0f14d83 (diff)
downloadscripts.irssi.org-eb763cd5810dfce73989c0ef54d91ce0018449a5.tar.bz2
nickserv.pl: Add support for Freenode and irc.perl.org
Freenode includes control characters in its notices, so strip these. Also removes a redundant regexp from the if clause for /msg NickServ style services.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nickserv.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/nickserv.pl b/scripts/nickserv.pl
index a337e8b..c1d9ce8 100644
--- a/scripts/nickserv.pl
+++ b/scripts/nickserv.pl
@@ -24,7 +24,7 @@ use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
-$VERSION = "1.9";
+$VERSION = "1.10";
%IRSSI = (
authors => 'Geert Hauwaerts',
@@ -33,7 +33,6 @@ $VERSION = "1.9";
description => 'This script will authorize you into NickServ.',
license => 'GNU General Public License',
url => 'http://irssi.hauwaerts.be/nickserv.pl',
- changed => 'Tue Jul 1 12:41:23 PDT 2014',
);
my @nickservnet = ();
@@ -389,7 +388,9 @@ sub nickserv_notice {
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
if (is_nickserv($server->{tag}, $address)) {
- if ($text =~ /^If this is your nickname, type \/msg NickServ/ || $text =~ /^This nickname is registered and protected. If it is your/ || $text =~ /This nickname is registered\. Please choose a different nickname,/ || $text =~ /^This nickname is registered. Please choose a different nickname/) {
+ $text =~ s/[[:cntrl:]]+//g; # remove control crap
+
+ if ($text =~ /^(?:If this is your nickname, type|Please identify via|Type) \/msg NickServ (?i:identify)/ || $text =~ /^This nickname is registered and protected. If it is your/ || $text =~ /This nickname is registered\. Please choose a different nickname/) {
my $password = get_password($server->{tag}, $server->{nick});
if ($password == -1) {
@@ -436,9 +437,9 @@ sub nickserv_notice {
Irssi::signal_stop();
} elsif ($text =~ /^please choose a different nick./) {
Irssi::signal_stop();
- } elsif ($text =~ /^You have already identified/ || $text =~ /^This nick is already identified./) {
+ } elsif ($text =~ /^You have already identified/ || $text =~ /^This nick is already identified./ || $text =~ /^You are already logged in as/) {
Irssi::signal_stop();
- } elsif ($text =~ /^Password accepted - you are now recognized/) {
+ } elsif ($text =~ /^Password accepted - you are now recognized/ || $text =~ /^You are now identified for/) {
Irssi::signal_stop();
Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'password_accepted', $server->{tag});
} elsif ($text =~ /^Password Incorrect/ || $text =~ /^Password incorrect./) {