From f90a1b97b467ae9fabf5754f9f54791f1c9b595e Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 14 Jul 2013 09:29:22 +0000 Subject: [PATCH] if user JOIN channel with !currentNick, update [#532] --- modules/users/users.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/users/users.js b/modules/users/users.js index e102f87..73c4ceb 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -95,7 +95,6 @@ var users = function(dbot) { }; this.listener = function(event) { - // TODO: If user joins channel with alias if(event.action == 'JOIN' && event.user != dbot.config.name) { if(!event.rUser) { this.internalAPI.createUser(event.server, event.user, function(user) { @@ -104,6 +103,11 @@ var users = function(dbot) { } else if(!_.include(event.rUser.channels, event.rChannel.id)) { this.internalAPI.addChannelUser(event.rChannel, event.rUser, function() {}); } + + if(event.rUser.currentNick != event.user) { + event.rUser.currentNick = event.user; + this.db.save('users', event.rUser.id, event.rUser, function() {}); + } } else if(event.action == 'NICK') { this.api.isKnownUser(event.server, event.newNick, function(isKnown) { event.rUser.currentNick = event.newNick;