From bbd03e4e0f9b8add465db46101365486a29a9997 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Mon, 26 Jan 2015 12:20:19 -0600 Subject: [PATCH] Log aliases when someone logs in --- lib/channel/channel.js | 10 ++++++---- lib/user.js | 6 ------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/channel/channel.js b/lib/channel/channel.js index da9b6028..8f268e80 100644 --- a/lib/channel/channel.js +++ b/lib/channel/channel.js @@ -375,10 +375,6 @@ Channel.prototype.acceptUser = function (user) { this.logger.log("[login] Accepted connection from " + user.displayip); } - if (user.is(Flags.U_LOGGED_IN)) { - this.logger.log("[login] " + user.displayip + " authenticated as " + user.getName()); - } - var self = this; user.waitFlag(Flags.U_LOGGED_IN, function () { for (var i = 0; i < self.users.length; i++) { @@ -387,6 +383,12 @@ Channel.prototype.acceptUser = function (user) { self.users[i].kick("Duplicate login"); } } + + var loginStr = "[login] " + user.displayip + " logged in as " + user.getName(); + if (user.account.globalRank === 0) loginStr += " (guest)"; + loginStr += " (aliases: " + user.account.aliases.join(",") + ")"; + self.logger.log(loginStr); + self.sendUserJoin(self.users, user); }); diff --git a/lib/user.js b/lib/user.js index c69b5982..0c21b68f 100644 --- a/lib/user.js +++ b/lib/user.js @@ -288,9 +288,6 @@ User.prototype.login = function (name, pw) { db.recordVisit(self.realip, self.getName()); self.socket.emit("rank", self.account.effectiveRank); Logger.syslog.log(self.realip + " logged in as " + user.name); - if (self.inChannel()) { - self.channel.logger.log(self.displayip + " logged in as " + user.name); - } self.setFlag(Flags.U_LOGGED_IN); self.clearFlag(Flags.U_LOGGING_IN); self.emit("login", self.account); @@ -378,9 +375,6 @@ User.prototype.guestLogin = function (name) { db.recordVisit(self.realip, self.getName()); self.socket.emit("rank", 0); Logger.syslog.log(self.realip + " signed in as " + name); - if (self.inChannel()) { - self.channel.logger.log(self.displayip + " signed in as " + name); - } self.setFlag(Flags.U_LOGGED_IN); self.emit("login", self.account); });