[mirotalksfu] - on eject ban user, update dep.

هذا الالتزام موجود في:
Miroslav Pejic
2024-01-29 18:06:07 +01:00
الأصل f610949cee
التزام 9b23ae5d00
5 ملفات معدلة مع 85 إضافات و8 حذوفات

عرض الملف

@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.3.57
* @version 1.3.58
*
*/
@@ -3091,6 +3091,14 @@ function wbDrawing(status) {
// HANDLE PARTICIPANTS
// ####################################################
async function getRemotePeerInfo(peer_id) {
const peers = await getRoomPeers();
for (let peer of Array.from(peers.keys()).filter((id) => id === peer_id)) {
return peers.get(peer).peer_info;
}
return false;
}
async function getRoomPeers() {
let room_info = await rc.getRoomInfo();
return new Map(JSON.parse(room_info.peers));

عرض الملف

@@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.3.57
* @version 1.3.58
*
*/
@@ -356,6 +356,10 @@ class RoomClient {
console.log('00-WARNING ----> Room Lobby Enabled, Wait to confirm my join');
return this.waitJoinConfirm();
}
if (room === 'isBanned') {
console.log('00-WARNING ----> You are Banned from the Room!');
return this.isBanned();
}
const peers = new Map(JSON.parse(room.peers));
for (let peer of Array.from(peers.keys()).filter((id) => id !== this.peer_id)) {
let peer_info = peers.get(peer).peer_info;
@@ -5232,6 +5236,25 @@ class RoomClient {
});
}
isBanned() {
this.sound('alert');
Swal.fire({
allowOutsideClick: false,
allowEscapeKey: false,
showDenyButton: false,
showConfirmButton: true,
background: swalBackground,
imageUrl: image.forbidden,
title: 'Banned',
text: 'You are banned from this room!',
confirmButtonText: `Ok`,
showClass: { popup: 'animate__animated animate__fadeInDown' },
hideClass: { popup: 'animate__animated animate__fadeOutUp' },
}).then(() => {
this.exit();
});
}
// ####################################################
// HANDLE AUDIO VOLUME
// ####################################################
@@ -5394,7 +5417,7 @@ class RoomClient {
// PEER ACTION
// ####################################################
peerAction(from_peer_name, id, action, emit = true, broadcast = false, info = true, msg = '') {
async peerAction(from_peer_name, id, action, emit = true, broadcast = false, info = true, msg = '') {
const words = id.split('___');
const peer_id = words[0];
@@ -5403,6 +5426,7 @@ class RoomClient {
from_peer_name: this.peer_name,
from_peer_id: this.peer_id,
from_peer_uuid: this.peer_uuid,
to_peer_uuid: '',
peer_id: peer_id,
action: action,
message: '',
@@ -5481,6 +5505,13 @@ class RoomClient {
}
}
break;
case 'eject':
if (!isRulesActive || isPresenter) {
const peer_info = await getRemotePeerInfo(peer_id);
console.log('EJECT PEER', peer_info);
if (peer_info) data.to_peer_uuid = peer_info.peer_uuid;
}
break;
default:
break;
}