diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 60880d579..46e48b660 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -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) {