diff --git a/modules/nickserv/nickserv.js b/modules/nickserv/nickserv.js index ce4bff9..afa252a 100644 --- a/modules/nickserv/nickserv.js +++ b/modules/nickserv/nickserv.js @@ -25,7 +25,7 @@ var nickserv = function(dbot) { if(_.has(this.userStack[server], nick)) { callback(false); } - }, 4000); + }.bind(this), 4000); } }.bind(this), 4000); } @@ -77,17 +77,19 @@ var nickserv = function(dbot) { } else if(event.action == '302') { var match = event.params.match(/:(.+)=([^@]+)@(.+)$/); - if(match[1]) match[1] = match[1].replace('\*', ''); + if(match && match[1]) match[1] = match[1].replace('\*', ''); if(match && _.has(this.userStack, event.server) && _.has(this.userStack[event.server], match[1])) { var callback = this.userStack[event.server][match[1]]; delete this.userStack[event.server][match[1]]; callback(match[3].trim()); } } else if(event.action == '314') { - var params = event.message.split(' '), + var params = event.params.split(' '), nick = params[1], host = params[3]; + console.log(params); + if(_.has(this.userStack, event.server) && _.has(this.userStack[event.server], nick)) { var callback = this.userStack[event.server][nick]; delete this.userStack[event.server][nick];