Adhering to change in socket.io, Release 1.1.16
This commit is contained in:
parent
9e16242c2c
commit
721e80aa1f
|
@ -27,3 +27,6 @@ node_modules
|
||||||
# Users Environment Variables
|
# Users Environment Variables
|
||||||
.lock-wscript
|
.lock-wscript
|
||||||
docs/Thumbs.db
|
docs/Thumbs.db
|
||||||
|
|
||||||
|
# Vim temp files
|
||||||
|
*.swp
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "cryptalk",
|
"name" : "cryptalk",
|
||||||
"version" : "1.1.15",
|
"version" : "1.1.16",
|
||||||
"description" : "Encrypted HTML5/Node.JS instant chat",
|
"description" : "Encrypted HTML5/Node.JS instant chat",
|
||||||
"main" : "server.js",
|
"main" : "server.js",
|
||||||
"subdomain": "cryptalk",
|
"subdomain": "cryptalk",
|
||||||
|
|
|
@ -53,7 +53,7 @@ io.on('connection', function(socket) {
|
||||||
socket.on('room:count', function (req) {
|
socket.on('room:count', function (req) {
|
||||||
if( socket.current_room !== undefined ) {
|
if( socket.current_room !== undefined ) {
|
||||||
var clientsList = io.sockets.adapter.rooms[socket.current_room];
|
var clientsList = io.sockets.adapter.rooms[socket.current_room];
|
||||||
socket.emit('message:server', {msg:'person_count', payload: Object.keys(clientsList).length } );
|
socket.emit('message:server', {msg:'person_count', payload: clientsList.length } );
|
||||||
} else {
|
} else {
|
||||||
socket.emit('message:server', {msg:'command_failed'} );
|
socket.emit('message:server', {msg:'command_failed'} );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue