[mirotalksfu] - lint
هذا الالتزام موجود في:
@@ -40,8 +40,6 @@ module.exports = class Peer {
|
|||||||
this.producers = new Map();
|
this.producers = new Map();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ####################################################
|
// ####################################################
|
||||||
// UPDATE PEER INFO
|
// UPDATE PEER INFO
|
||||||
// ####################################################
|
// ####################################################
|
||||||
|
|||||||
@@ -2462,13 +2462,13 @@ function startServer() {
|
|||||||
room.sendTo(peer_id, 'roomLobby', data);
|
room.sendTo(peer_id, 'roomLobby', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.lobby_status === 'accept') {
|
if (data.lobby_status === 'accept') {
|
||||||
for (const peer_id of pears_id) {
|
for (const peer_id of pears_id) {
|
||||||
const peer = room.getPeer(peer_id);
|
const peer = room.getPeer(peer_id);
|
||||||
if (!peer.peer_lobby) continue;
|
if (!peer.peer_lobby) continue;
|
||||||
|
|
||||||
peer.updatePeerInfo({ type: 'lobby', status: false });
|
peer.updatePeerInfo({ type: 'lobby', status: false });
|
||||||
|
|
||||||
handleJoinWebHook(room.id, peer.peer_info);
|
handleJoinWebHook(room.id, peer.peer_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3500,7 +3500,6 @@ function startServer() {
|
|||||||
callback('Successfully exited room');
|
callback('Successfully exited room');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
|
|
||||||
async function handleJoinWebHook(room_id, peer_info) {
|
async function handleJoinWebHook(room_id, peer_info) {
|
||||||
@@ -3512,12 +3511,12 @@ function startServer() {
|
|||||||
room_id,
|
room_id,
|
||||||
peer_info,
|
peer_info,
|
||||||
};
|
};
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.post(webhook.url, { event: 'join', data })
|
.post(webhook.url, { event: 'join', data })
|
||||||
.then((response) => log.debug('Join event tracked:', response.data))
|
.then((response) => log.debug('Join event tracked:', response.data))
|
||||||
.catch((error) => log.error('Error tracking join event:', error.message));
|
.catch((error) => log.error('Error tracking join event:', error.message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRoomAndPeer(socket) {
|
function getRoomAndPeer(socket) {
|
||||||
|
|||||||
@@ -739,10 +739,11 @@ class RoomClient {
|
|||||||
for (let peer of Array.from(this.peers.keys()).filter((id) => id !== this.peer_id)) {
|
for (let peer of Array.from(this.peers.keys()).filter((id) => id !== this.peer_id)) {
|
||||||
let peer_info = this.peers.get(peer).peer_info;
|
let peer_info = this.peers.get(peer).peer_info;
|
||||||
// console.log('07.1 ----> Remote Peer info', peer_info);
|
// console.log('07.1 ----> Remote Peer info', peer_info);
|
||||||
const { peer_id, peer_name, peer_avatar, peer_presenter, peer_video, peer_recording, peer_lobby } = peer_info;
|
const { peer_id, peer_name, peer_avatar, peer_presenter, peer_video, peer_recording, peer_lobby } =
|
||||||
|
peer_info;
|
||||||
|
|
||||||
if (peer_lobby) {
|
if (peer_lobby) {
|
||||||
this.lobbyAddPear({peer_id, peer_avatar, peer_name});
|
this.lobbyAddPear({ peer_id, peer_avatar, peer_name });
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7886,14 +7887,14 @@ class RoomClient {
|
|||||||
switch (data.lobby_status) {
|
switch (data.lobby_status) {
|
||||||
case 'waiting':
|
case 'waiting':
|
||||||
if (!isRulesActive || isPresenter) {
|
if (!isRulesActive || isPresenter) {
|
||||||
const {peer_id, peer_name, peer_avatar} = data;
|
const { peer_id, peer_name, peer_avatar } = data;
|
||||||
this.lobbyAddPear({peer_id, peer_name, peer_avatar});
|
this.lobbyAddPear({ peer_id, peer_name, peer_avatar });
|
||||||
this.userLog('info', peer_name + ' wants to join the meeting', 'top-end');
|
this.userLog('info', peer_name + ' wants to join the meeting', 'top-end');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'accept':
|
case 'accept':
|
||||||
if (this.lobbyRemovePearForPresenter(data)) {
|
if (this.lobbyRemovePearForPresenter(data)) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
this.RoomLobbyAccepted = true;
|
this.RoomLobbyAccepted = true;
|
||||||
await this.joinAllowed(data.room);
|
await this.joinAllowed(data.room);
|
||||||
@@ -7903,7 +7904,7 @@ class RoomClient {
|
|||||||
break;
|
break;
|
||||||
case 'reject':
|
case 'reject':
|
||||||
if (this.lobbyRemovePearForPresenter(data)) {
|
if (this.lobbyRemovePearForPresenter(data)) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
this.RoomLobbyAccepted = false;
|
this.RoomLobbyAccepted = false;
|
||||||
this.sound('eject');
|
this.sound('eject');
|
||||||
@@ -7929,11 +7930,9 @@ class RoomClient {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lobbyRemovePearForPresenter(data) {
|
lobbyRemovePearForPresenter(data) {
|
||||||
const peers_id = data.peers_id?.length > 0
|
const peers_id = data.peers_id?.length > 0 ? data.peers_id : [data.peer_id];
|
||||||
? data.peers_id
|
|
||||||
: [data.peer_id]
|
|
||||||
|
|
||||||
// This current pear is in lobby accept request
|
// This current pear is in lobby accept request
|
||||||
// It means that most probably we this pear is eaitin in lobby right now
|
// It means that most probably we this pear is eaitin in lobby right now
|
||||||
@@ -7964,8 +7963,8 @@ class RoomClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lobbyAcceptAll() {
|
lobbyAcceptAll() {
|
||||||
const lobbyPearsIds = this.lobbyGetPeerIds()
|
const lobbyPearsIds = this.lobbyGetPeerIds();
|
||||||
console.log('lobbyAcceptAll', lobbyPearsIds, lobbyPearsIds.length)
|
console.log('lobbyAcceptAll', lobbyPearsIds, lobbyPearsIds.length);
|
||||||
if (lobbyPearsIds.length > 0) {
|
if (lobbyPearsIds.length > 0) {
|
||||||
const data = this.lobbyGetData('accept', lobbyPearsIds);
|
const data = this.lobbyGetData('accept', lobbyPearsIds);
|
||||||
this.socket.emit('roomLobby', data);
|
this.socket.emit('roomLobby', data);
|
||||||
@@ -7976,7 +7975,7 @@ class RoomClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
lobbyRejectAll() {
|
lobbyRejectAll() {
|
||||||
const lobbyPearsIds = this.lobbyGetPeerIds()
|
const lobbyPearsIds = this.lobbyGetPeerIds();
|
||||||
if (lobbyPearsIds.length > 0) {
|
if (lobbyPearsIds.length > 0) {
|
||||||
const data = this.lobbyGetData('reject', lobbyPearsIds);
|
const data = this.lobbyGetData('reject', lobbyPearsIds);
|
||||||
this.socket.emit('roomLobby', data);
|
this.socket.emit('roomLobby', data);
|
||||||
@@ -8010,14 +8009,14 @@ class RoomClient {
|
|||||||
const lobbyTb = this.getId('lobbyTb');
|
const lobbyTb = this.getId('lobbyTb');
|
||||||
|
|
||||||
for (const peer_id of Object.keys(this.lobbyPears)) {
|
for (const peer_id of Object.keys(this.lobbyPears)) {
|
||||||
const {peer_name, peer_avatar} = this.lobbyPears[peer_id];
|
const { peer_name, peer_avatar } = this.lobbyPears[peer_id];
|
||||||
|
|
||||||
const avatarImg =
|
const avatarImg =
|
||||||
peer_avatar && this.isImageURL(peer_avatar)
|
peer_avatar && this.isImageURL(peer_avatar)
|
||||||
? peer_avatar
|
? peer_avatar
|
||||||
: this.isValidEmail(peer_name)
|
: this.isValidEmail(peer_name)
|
||||||
? this.genGravatar(peer_name, 32)
|
? this.genGravatar(peer_name, 32)
|
||||||
: this.genAvatarSvg(peer_name, 32);
|
: this.genAvatarSvg(peer_name, 32);
|
||||||
|
|
||||||
const lobbyAcceptId = `${peer_name}___${peer_id}___lobbyAccept`;
|
const lobbyAcceptId = `${peer_name}___${peer_id}___lobbyAccept`;
|
||||||
const lobbyRejectId = `${peer_name}___${peer_id}___lobbyReject`;
|
const lobbyRejectId = `${peer_name}___${peer_id}___lobbyReject`;
|
||||||
@@ -8041,13 +8040,12 @@ class RoomClient {
|
|||||||
this.lobbyToggle();
|
this.lobbyToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lobbyParticipantsCount() {
|
lobbyParticipantsCount() {
|
||||||
return Object.keys(this.lobbyPears).length;
|
return Object.keys(this.lobbyPears).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
lobbyGetPeerIds() {
|
lobbyGetPeerIds() {
|
||||||
return Object.keys(this.lobbyPears)
|
return Object.keys(this.lobbyPears);
|
||||||
}
|
}
|
||||||
|
|
||||||
lobbyGetData(status, peers_id = []) {
|
lobbyGetData(status, peers_id = []) {
|
||||||
|
|||||||
@@ -1714,8 +1714,7 @@ access to use this app.
|
|||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<table id="lobbyTb">
|
<table id="lobbyTb"></table>
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم