[mirotalksfu] - improve refreshParticipantsCount

هذا الالتزام موجود في:
Miroslav Pejic
2021-10-02 11:31:01 +02:00
الأصل 018941f4e7
التزام 2c3105846d
3 ملفات معدلة مع 2 إضافات و7 حذوفات

عرض الملف

@@ -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) => {