update currentNick in event pre-emit [close #547]

This commit is contained in:
reality 2013-08-17 16:35:57 +00:00
parent 897b27f31e
commit 06053b9e17

View File

@ -175,8 +175,13 @@ var users = function(dbot) {
if(event.user) {
this.api.resolveUser(event.server, event.user, function(user) {
event.rUser = user;
if(event.rUser.currentNick !== event.user) {
event.rUser.currentNick = event.user;
this.db.save('users', event.rUser.id, event.rUser, callback);
} else {
callback(false);
});
}
}.bind(this));
} else {
callback(false);
}