should fix it

switch-to-pad
John McLear 2014-11-15 16:37:27 +00:00
parent 4297fd5916
commit e175334757
1 changed files with 6 additions and 1 deletions

View File

@ -878,7 +878,12 @@ function handleSwitchToPad(client, message)
// clear the session and leave the room // clear the session and leave the room
var currentSession = sessioninfos[client.id]; var currentSession = sessioninfos[client.id];
var padId = currentSession.padId; 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++) { for(var i = 0; i < roomClients.length; i++) {
var sinfo = sessioninfos[roomClients[i].id]; var sinfo = sessioninfos[roomClients[i].id];
if(sinfo && sinfo.author == currentSession.author) { if(sinfo && sinfo.author == currentSession.author) {