Adhering to change in socket.io, Release 1.1.16

This commit is contained in:
Hexagon 2017-01-23 22:29:23 +01:00
parent 9e16242c2c
commit 721e80aa1f
3 changed files with 5 additions and 2 deletions

3
.gitignore vendored
View File

@ -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

View File

@ -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",

View File

@ -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'} );
} }