From 06053b9e17ff0b821ceb0acdeab5f758084b1d6e Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 17 Aug 2013 16:35:57 +0000 Subject: [PATCH] update currentNick in event pre-emit [close #547] --- modules/users/users.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/users/users.js b/modules/users/users.js index e8c376e..26bbc42 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -175,8 +175,13 @@ var users = function(dbot) { if(event.user) { this.api.resolveUser(event.server, event.user, function(user) { event.rUser = user; - callback(false); - }); + 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); }