3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +01:00

working userhost api function [Close #498]

This commit is contained in:
reality 2013-06-09 16:55:46 +00:00
parent 995a5125bc
commit 47e9672b32

View File

@ -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'];