From 47e9672b3275a3735693cfc99867e058a341c989 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 9 Jun 2013 16:55:46 +0000 Subject: [PATCH] working userhost api function [Close #498] --- modules/nickserv/nickserv.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/nickserv/nickserv.js b/modules/nickserv/nickserv.js index e501b32..8e9559a 100644 --- a/modules/nickserv/nickserv.js +++ b/modules/nickserv/nickserv.js @@ -1,3 +1,5 @@ +var _ = require('underscore')._; + var nickserv = function(dbot) { this.authStack = {}; this.userStack = {}; @@ -36,8 +38,10 @@ var nickserv = function(dbot) { } } } else if(event.action == '302') { - console.log('caught'); - console.log(event.params); + var match = event.params.match(/:(.*)=([^@]+)@(.+)$/); + if(match && _.has(this.userStack, event.server) && _.has(this.userStack[event.server], match[1])) { + this.userStack[event.server][match[1]](match[3].trim()); + } } }.bind(this); this.on = ['NOTICE', '302'];