forked from GitHub/dbot
fix nickstealing
This commit is contained in:
parent
402c8e80f4
commit
77d9997009
@ -107,10 +107,12 @@ var users = function(dbot) {
|
||||
// Update current nick
|
||||
this.api.resolveUser(event.server, event.user, function(err, user) {
|
||||
if(user) {
|
||||
this.internalAPI.updateCurrentNick(user, event.newNick, function(){});
|
||||
this.api.resolveUser(event.server, event.newNick, function(err, eUser) {
|
||||
if(!eUser) {
|
||||
this.internalAPI.createAlias(event.newNick, user, function(){});
|
||||
this.internalAPI.updateCurrentNick(user, event.newNick, function(){});
|
||||
} else if(user.id === eUser.id) {
|
||||
this.internalAPI.updateCurrentNick(user, event.newNick, function(){});
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user