mirror of https://github.com/calzoneman/sync.git
Add an extra check and log message
This commit is contained in:
parent
bca7199ec1
commit
4c34625d48
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Sep 7 15:43 2013 CDT
|
||||||
|
* lib/channel.js, lib/user.js: Add an extra check for channel.users[i]
|
||||||
|
to write an error message (instead of kicking) when the same user that
|
||||||
|
is connecting is the one being kicked.
|
||||||
|
|
||||||
Fri Sep 6 16:29 2013 CDT
|
Fri Sep 6 16:29 2013 CDT
|
||||||
* lib/config.js: Add an io-host option to allow binding socket.io to
|
* lib/config.js: Add an io-host option to allow binding socket.io to
|
||||||
a different IP than the webserver
|
a different IP than the webserver
|
||||||
|
|
|
@ -757,6 +757,11 @@ 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()) {
|
||||||
|
if (this.users[i] == user) {
|
||||||
|
Logger.errlog.log("Wat: userJoin() called on user "+
|
||||||
|
"already in the channel");
|
||||||
|
break;
|
||||||
|
}
|
||||||
this.kick(this.users[i], "Duplicate login");
|
this.kick(this.users[i], "Duplicate login");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -639,6 +639,11 @@ User.prototype.login = function(name, pw, session) {
|
||||||
if(self.channel != null) {
|
if(self.channel != null) {
|
||||||
for(var i = 0; i < self.channel.users.length; i++) {
|
for(var i = 0; i < self.channel.users.length; i++) {
|
||||||
if(self.channel.users[i].name.toLowerCase() == name.toLowerCase()) {
|
if(self.channel.users[i].name.toLowerCase() == name.toLowerCase()) {
|
||||||
|
if (self.channel.users[i] == self) {
|
||||||
|
Logger.errlog.log("Wat: user.login() but user"+
|
||||||
|
"already logged in on channel");
|
||||||
|
break;
|
||||||
|
}
|
||||||
self.channel.kick(self.channel.users[i], "Duplicate login");
|
self.channel.kick(self.channel.users[i], "Duplicate login");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue