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
|
||||
.lock-wscript
|
||||
docs/Thumbs.db
|
||||
|
||||
# Vim temp files
|
||||
*.swp
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name" : "cryptalk",
|
||||
"version" : "1.1.15",
|
||||
"version" : "1.1.16",
|
||||
"description" : "Encrypted HTML5/Node.JS instant chat",
|
||||
"main" : "server.js",
|
||||
"subdomain": "cryptalk",
|
||||
|
|
|
@ -53,7 +53,7 @@ io.on('connection', function(socket) {
|
|||
socket.on('room:count', function (req) {
|
||||
if( socket.current_room !== undefined ) {
|
||||
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 {
|
||||
socket.emit('message:server', {msg:'command_failed'} );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue