[mirotalksfu] - add moderator rule - cant chat privately

هذا الالتزام موجود في:
Miroslav Pejic
2023-12-01 14:21:00 +01:00
الأصل f0d2e9f3bd
التزام c629bfabf2
7 ملفات معدلة مع 57 إضافات و6 حذوفات

عرض الملف

@@ -25,6 +25,7 @@ class LocalStorage {
moderator_audio_cant_unmute: false, // Everyone can't unmute themselves
moderator_video_cant_unhide: false, // Everyone can't unhide themselves
moderator_screen_cant_share: false, // Everyone can't share screen
moderator_chat_cant_privately: false, // Everyone can't chat privately, only Public chat allowed
mic_auto_gain_control: false,
mic_echo_cancellations: true,
mic_noise_suppression: true,

عرض الملف

@@ -1905,6 +1905,14 @@ function handleSelects() {
lS.setSettings(lsSettings);
e.target.blur();
};
switchEveryoneCantChatPrivately.onchange = (e) => {
const chatCantPrivately = e.currentTarget.checked;
rc.updateRoomModerator({ type: 'chat_cant_privately', status: chatCantPrivately });
rc.roomMessage('chat_cant_privately', chatCantPrivately);
lsSettings.moderator_chat_cant_privately = chatCantPrivately;
lS.setSettings(lsSettings);
e.target.blur();
};
}
// ####################################################

عرض الملف

@@ -168,6 +168,7 @@ class RoomClient {
audio_cant_unmute: false,
video_cant_unhide: false,
screen_cant_share: false,
chat_cant_privately: false,
};
this.isAudioAllowed = isAudioAllowed;
@@ -400,15 +401,17 @@ class RoomClient {
this._moderator.audio_cant_unmute = room.moderator.audio_cant_unmute;
this._moderator.video_cant_unhide = room.moderator.video_cant_unhide;
this._moderator.screen_cant_share = room.moderator.screen_cant_share;
this._moderator.chat_cant_privately = room.moderator.chat_cant_privately;
//
if (this._moderator.audio_start_muted && this._moderator.video_start_hidden) {
this.userLog('warning', 'The Moderator disabled your audio and video', 'top-end');
}
if (this._moderator.audio_start_muted && !this._moderator.video_start_hidden) {
this.userLog('warning', 'The Moderator disabled your audio', 'top-end');
}
if (!this._moderator.audio_start_muted && this._moderator.video_start_hidden) {
this.userLog('warning', 'The Moderator disabled your video', 'top-end');
} else {
if (this._moderator.audio_start_muted && !this._moderator.video_start_hidden) {
this.userLog('warning', 'The Moderator disabled your audio', 'top-end');
}
if (!this._moderator.audio_start_muted && this._moderator.video_start_hidden) {
this.userLog('warning', 'The Moderator disabled your video', 'top-end');
}
}
//
this._moderator.audio_cant_unmute ? hide(tabAudioDevicesBtn) : show(tabAudioDevicesBtn);
@@ -4745,6 +4748,13 @@ class RoomClient {
'top-end',
);
break;
case 'chat_cant_privately':
this.userLog(
'info',
`${icons.moderator} Moderator: everyone can't chat privately ${status}`,
'top-end',
);
break;
default:
break;
}
@@ -5531,6 +5541,9 @@ class RoomClient {
this.getId('chatPublicMessages').style.display = 'block';
break;
default:
if (this._moderator.chat_cant_privately) {
return userLog('warning', 'The moderator does not allow you to chat privately', 'top-end', 6000);
}
chatAbout.innerHTML = generateChatAboutHTML(avatarImg, peer_name);
chatPrivateMessages.style.display = 'block';
for (let i = 0; i < messagePrivateListItems.length; i++) {
@@ -5600,6 +5613,10 @@ class RoomClient {
this._moderator.screen_cant_share = data.status;
rc.roomMessage('screen_cant_share', data.status);
break;
case 'chat_cant_privately':
this._moderator.chat_cant_privately = data.status;
rc.roomMessage('chat_cant_privately', data.status);
break;
default:
break;
}

عرض الملف

@@ -142,6 +142,7 @@ function handleRules(isPresenter) {
switchEveryoneCantUnmute.checked = lsSettings.moderator_audio_cant_unmute;
switchEveryoneCantUnhide.checked = lsSettings.moderator_video_cant_unhide;
switchEveryoneCantShareScreen.checked = lsSettings.moderator_screen_cant_share;
switchEveryoneCantChatPrivately.checked = lsSettings.moderator_chat_cant_privately;
// Update moderator settings...
const moderatorData = {
audio_start_muted: switchEveryoneMute.checked,
@@ -149,6 +150,7 @@ function handleRules(isPresenter) {
audio_cant_unmute: switchEveryoneCantUnmute.checked,
video_cant_unhide: switchEveryoneCantUnhide.checked,
screen_cant_share: switchEveryoneCantShareScreen.checked,
chat_cant_privately: switchEveryoneCantChatPrivately.checked,
};
rc.updateRoomModeratorALL(moderatorData);
}

عرض الملف

@@ -698,6 +698,24 @@ access to use this app.
</div>
</td>
</tr>
<tr id="everyoneCantChatPrivatelyBtn">
<td style="width: auto">
<div class="title">
<i class="fa-solid fa-comments red"></i>
<p>Everyone can't chat privately</p>
</div>
</td>
<td>
<div class="form-check form-switch form-switch-md">
<input
id="switchEveryoneCantChatPrivately"
class="form-check-input"
type="checkbox"
checked
/>
</div>
</td>
</tr>
</table>
</div>