mirror of https://github.com/calzoneman/sync.git
Fix #165
This commit is contained in:
parent
2c57d2a8f2
commit
ae55f44906
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
6
user.js
6
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue