[mirotalksfu] - improve refreshParticipantsCount

main
Miroslav Pejic 5 years ago
parent 018941f4e7
commit 2c3105846d

@ -1219,6 +1219,7 @@ class RoomClient {
}
thereIsParticipants() {
// console.log('participantsCount ---->', participantsCount);
if (this.consumers.size > 0 || participantsCount > 1) {
return true;
}

@ -216,12 +216,6 @@ module.exports = class Room {
}
}
sendToAll(action, data) {
for (let peer_id of Array.from(this.peers.keys())) {
this.send(peer_id, action, data);
}
}
send(socket_id, action, data) {
this.io.to(socket_id).emit(action, data);
}

@ -416,7 +416,7 @@ io.on('connection', (socket) => {
peer_counts: roomList.get(socket.room_id).getPeers().size,
};
log.debug('Refresh Participants count', data);
roomList.get(socket.room_id).sendToAll('refreshParticipantsCount', data);
roomList.get(socket.room_id).broadCast(socket.id, 'refreshParticipantsCount', data);
});
socket.on('message', (data) => {

Loading…
Cancel
Save