fix sockets of switch to pad

pull/2413/head
John McLear 2014-12-29 00:46:47 +01:00
parent 6b1fee400d
commit 8603fb4583
1 changed files with 7 additions and 1 deletions

View File

@ -902,7 +902,13 @@ function handleSwitchToPad(client, message)
// clear the session and leave the room
var currentSession = sessioninfos[client.id];
var padId = currentSession.padId;
var roomClients = socketio.sockets.clients(padId);
var roomClients = [], room = socketio.sockets.adapter.rooms[padId];
if (room) {
for (var id in room) {
roomClients.push(socketio.sockets.adapter.nsp.connected[id]);
}
}
for(var i = 0; i < roomClients.length; i++) {
var sinfo = sessioninfos[roomClients[i].id];
if(sinfo && sinfo.author == currentSession.author) {