From 964eadd1c2965cdc0505fc382880d742d552ce79 Mon Sep 17 00:00:00 2001 From: Mike Tsao Date: Tue, 26 Aug 2014 19:48:09 -0700 Subject: [PATCH 1/2] #322: auto_identify recognizes /msg NickServ IDENTIFY user pass --- example_scripts/auto_identify.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/example_scripts/auto_identify.js b/example_scripts/auto_identify.js index 17e68250..37e7e998 100644 --- a/example_scripts/auto_identify.js +++ b/example_scripts/auto_identify.js @@ -47,7 +47,11 @@ var autoIdentify = function(context, message) { var nickServPasswordIsVisible = function(message) { var words = message.split(' '); - return words.length == 2 && words[0].toLowerCase() == 'identify'; + + // Handle both "/msg NickServ IDENTIFY user pass" and + // "/msg NickServ IDENTIFY pass" + return ((words.length == 1 || words.length == 2) && + words[0].toLowerCase() == 'identify'); }; var snoopPassword = function(context, message) { From 6e7f02438a69844698a457d27f48992c16611b84 Mon Sep 17 00:00:00 2001 From: Mike Tsao Date: Fri, 29 Aug 2014 17:34:54 +0000 Subject: [PATCH 2/2] Off-by-one error --- example_scripts/auto_identify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_scripts/auto_identify.js b/example_scripts/auto_identify.js index 37e7e998..55df6c87 100644 --- a/example_scripts/auto_identify.js +++ b/example_scripts/auto_identify.js @@ -50,7 +50,7 @@ var nickServPasswordIsVisible = function(message) { // Handle both "/msg NickServ IDENTIFY user pass" and // "/msg NickServ IDENTIFY pass" - return ((words.length == 1 || words.length == 2) && + return ((words.length == 2 || words.length == 3) && words[0].toLowerCase() == 'identify'); };