3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00

314 fallback for hostmask

This commit is contained in:
reality 2013-08-25 23:04:46 +00:00
parent d3d25164c3
commit ee4ee92340

View File

@ -19,7 +19,14 @@ var nickserv = function(dbot) {
this.userStack[server][nick] = callback;
dbot.instance.connections[server].send('USERHOST ' + nick);
setTimeout(function() {
if(_.has(this.userStack[server], nick)) callback(false);
if(_.has(this.userStack[server], nick)) {
dbot.instance.connections[server].send('WHOWAS ' + nick);
setTimeout(function() {
if(_.has(this.userStack[server], nick)) {
callback(false);
}
}, 4000);
}
}.bind(this), 4000);
}
};
@ -76,9 +83,19 @@ var nickserv = function(dbot) {
delete this.userStack[event.server][match[1]];
callback(match[3].trim());
}
} else if(event.action == '314') {
var params = event.message.split(' '),
nick = params[1],
host = params[3];
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];
callback(host);
}
}
}.bind(this);
this.on = ['NOTICE', '302'];
this.on = ['NOTICE', '302', '314'];
};
exports.fetch = function(dbot) {