forked from GitHub/dbot
initial 302 USERHOST support in nickserv api [#498]
This commit is contained in:
parent
9dc9ebfd2e
commit
3e2f96fb11
@ -1,5 +1,6 @@
|
||||
var nickserv = function(dbot) {
|
||||
this.authStack = {};
|
||||
this.userStack = {};
|
||||
|
||||
this.api = {
|
||||
'auth': function(server, nick, callback) {
|
||||
@ -8,17 +9,22 @@ var nickserv = function(dbot) {
|
||||
|
||||
if(!_.has(this.authStack, server)) this.authStack[server] = {};
|
||||
this.authStack[server][nick] = callback;
|
||||
|
||||
dbot.say(server, nickserv, infoCommand + ' ' + nick);
|
||||
},
|
||||
|
||||
'getUserHost': function(server, nick, callback) {
|
||||
if(!_.has(this.userStack, server)) this.userStack[server] = {};
|
||||
this.userStack[server][nick] = callback;
|
||||
dbot.instance.connections.send('USERHOST ' + nick);
|
||||
}
|
||||
};
|
||||
|
||||
this.listener = function(event) {
|
||||
if(event.action == 'NOTICE') {
|
||||
var nickserv = dbot.config.servers[event.server].nickserv,
|
||||
statusRegex = this.config.servers[event.server].matcher,
|
||||
acceptableState = this.config.servers[event.server].acceptableState;
|
||||
|
||||
|
||||
if(event.user == nickserv) {
|
||||
var info = event.params.match(statusRegex);
|
||||
if(info && _.has(this.authStack, event.server)) {
|
||||
@ -29,6 +35,9 @@ var nickserv = function(dbot) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(event.action == '302') {
|
||||
console.log(event.params);
|
||||
}
|
||||
}.bind(this);
|
||||
this.on = 'NOTICE';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user