From ae55f449060bf1bd68da764f9648835b378e5b4b Mon Sep 17 00:00:00 2001 From: calzoneman Date: Tue, 4 Jun 2013 18:33:51 -0400 Subject: [PATCH] Fix #165 --- channel.js | 8 ++------ user.js | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/channel.js b/channel.js index af565ed4..cdef75a3 100644 --- a/channel.js +++ b/channel.js @@ -537,12 +537,8 @@ Channel.prototype.userJoin = function(user) { if(user.name != "") { for(var i = 0; i < this.users.length; i++) { if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) { - user.name = ""; - user.loggedIn = false; - user.socket.emit("login", { - success: false, - error: "The username " + user.name + " is already in use on this channel" - }); + console.log("DBG"); + this.kick(this.users[i], "Duplicate login"); } } } diff --git a/user.js b/user.js index 5175a9e6..c675570f 100644 --- a/user.js +++ b/user.js @@ -521,11 +521,7 @@ User.prototype.login = function(name, pw, session) { if(this.channel != null && name != "") { for(var i = 0; i < this.channel.users.length; i++) { if(this.channel.users[i].name == name) { - this.socket.emit("login", { - success: false, - error: "The username " + name + " is already in use on this channel" - }); - return false; + this.channel.kick(this.channel.users[i], "Duplicate login"); } } }