Fix #165
This commit is contained in:
parent
2c57d2a8f2
commit
ae55f44906
|
@ -537,12 +537,8 @@ Channel.prototype.userJoin = function(user) {
|
||||||
if(user.name != "") {
|
if(user.name != "") {
|
||||||
for(var i = 0; i < this.users.length; i++) {
|
for(var i = 0; i < this.users.length; i++) {
|
||||||
if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) {
|
if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) {
|
||||||
user.name = "";
|
console.log("DBG");
|
||||||
user.loggedIn = false;
|
this.kick(this.users[i], "Duplicate login");
|
||||||
user.socket.emit("login", {
|
|
||||||
success: false,
|
|
||||||
error: "The username " + user.name + " is already in use on this channel"
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
6
user.js
6
user.js
|
@ -521,11 +521,7 @@ User.prototype.login = function(name, pw, session) {
|
||||||
if(this.channel != null && name != "") {
|
if(this.channel != null && name != "") {
|
||||||
for(var i = 0; i < this.channel.users.length; i++) {
|
for(var i = 0; i < this.channel.users.length; i++) {
|
||||||
if(this.channel.users[i].name == name) {
|
if(this.channel.users[i].name == name) {
|
||||||
this.socket.emit("login", {
|
this.channel.kick(this.channel.users[i], "Duplicate login");
|
||||||
success: false,
|
|
||||||
error: "The username " + name + " is already in use on this channel"
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue