missing socketio fix
This commit is contained in:
parent
ff9a2a687f
commit
703440acd7
|
@ -496,14 +496,19 @@ function handleSuggestUserName(client, message)
|
|||
return;
|
||||
}
|
||||
|
||||
var padId = sessioninfos[client.id].padId,
|
||||
clients = socketio.sockets.clients(padId);
|
||||
var padId = sessioninfos[client.id].padId;
|
||||
var roomClients = [], room = socketio.sockets.adapter.rooms[padId];
|
||||
if (room) {
|
||||
for (var id in room) {
|
||||
roomClients.push(socketio.sockets.adapter.nsp.connected[id]);
|
||||
}
|
||||
}
|
||||
|
||||
//search the author and send him this message
|
||||
for(var i = 0; i < clients.length; i++) {
|
||||
var session = sessioninfos[clients[i].id];
|
||||
for(var i = 0; i < roomClients.length; i++) {
|
||||
var session = sessioninfos[roomClients[i].id];
|
||||
if(session && session.author == message.data.payload.unnamedId) {
|
||||
clients[i].json.send(message);
|
||||
roomClients[i].json.send(message);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue