[mirotalksfu] - add moderator rule - cant chat with CahtGPT
هذا الالتزام موجود في:
@@ -26,6 +26,7 @@ module.exports = class Room {
|
|||||||
video_cant_unhide: false,
|
video_cant_unhide: false,
|
||||||
screen_cant_share: false,
|
screen_cant_share: false,
|
||||||
chat_cant_privately: false,
|
chat_cant_privately: false,
|
||||||
|
chat_cant_chatgpt: false,
|
||||||
};
|
};
|
||||||
this.survey = config.survey;
|
this.survey = config.survey;
|
||||||
this.redirect = config.redirect;
|
this.redirect = config.redirect;
|
||||||
@@ -137,6 +138,9 @@ module.exports = class Room {
|
|||||||
case 'chat_cant_privately':
|
case 'chat_cant_privately':
|
||||||
this._moderator.chat_cant_privately = data.status;
|
this._moderator.chat_cant_privately = data.status;
|
||||||
break;
|
break;
|
||||||
|
case 'chat_cant_chatgpt':
|
||||||
|
this._moderator.chat_cant_chatgpt = data.status;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -815,6 +815,7 @@ function startServer() {
|
|||||||
case 'video_cant_unhide':
|
case 'video_cant_unhide':
|
||||||
case 'screen_cant_share':
|
case 'screen_cant_share':
|
||||||
case 'chat_cant_privately':
|
case 'chat_cant_privately':
|
||||||
|
case 'chat_cant_chatgpt':
|
||||||
room.broadCast(socket.id, 'updateRoomModerator', moderator);
|
room.broadCast(socket.id, 'updateRoomModerator', moderator);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class LocalStorage {
|
|||||||
moderator_video_cant_unhide: false, // Everyone can't unhide themselves
|
moderator_video_cant_unhide: false, // Everyone can't unhide themselves
|
||||||
moderator_screen_cant_share: false, // Everyone can't share screen
|
moderator_screen_cant_share: false, // Everyone can't share screen
|
||||||
moderator_chat_cant_privately: false, // Everyone can't chat privately, only Public chat allowed
|
moderator_chat_cant_privately: false, // Everyone can't chat privately, only Public chat allowed
|
||||||
|
moderator_chat_cant_chatgpt: false, // Everyone can't chat with ChatGPT
|
||||||
mic_auto_gain_control: false,
|
mic_auto_gain_control: false,
|
||||||
mic_echo_cancellations: true,
|
mic_echo_cancellations: true,
|
||||||
mic_noise_suppression: true,
|
mic_noise_suppression: true,
|
||||||
|
|||||||
@@ -1913,6 +1913,14 @@ function handleSelects() {
|
|||||||
lS.setSettings(lsSettings);
|
lS.setSettings(lsSettings);
|
||||||
e.target.blur();
|
e.target.blur();
|
||||||
};
|
};
|
||||||
|
switchEveryoneCantChatChatGPT.onchange = (e) => {
|
||||||
|
const chatCantChatGPT = e.currentTarget.checked;
|
||||||
|
rc.updateRoomModerator({ type: 'chat_cant_chatgpt', status: chatCantChatGPT });
|
||||||
|
rc.roomMessage('chat_cant_chatgpt', chatCantChatGPT);
|
||||||
|
lsSettings.moderator_chat_cant_chatgpt = chatCantChatGPT;
|
||||||
|
lS.setSettings(lsSettings);
|
||||||
|
e.target.blur();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// ####################################################
|
// ####################################################
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ class RoomClient {
|
|||||||
video_cant_unhide: false,
|
video_cant_unhide: false,
|
||||||
screen_cant_share: false,
|
screen_cant_share: false,
|
||||||
chat_cant_privately: false,
|
chat_cant_privately: false,
|
||||||
|
chat_cant_chatgpt: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.isAudioAllowed = isAudioAllowed;
|
this.isAudioAllowed = isAudioAllowed;
|
||||||
@@ -402,6 +403,7 @@ class RoomClient {
|
|||||||
this._moderator.video_cant_unhide = room.moderator.video_cant_unhide;
|
this._moderator.video_cant_unhide = room.moderator.video_cant_unhide;
|
||||||
this._moderator.screen_cant_share = room.moderator.screen_cant_share;
|
this._moderator.screen_cant_share = room.moderator.screen_cant_share;
|
||||||
this._moderator.chat_cant_privately = room.moderator.chat_cant_privately;
|
this._moderator.chat_cant_privately = room.moderator.chat_cant_privately;
|
||||||
|
this._moderator.chat_cant_chatgpt = room.moderator.chat_cant_chatgpt;
|
||||||
//
|
//
|
||||||
if (this._moderator.audio_start_muted && this._moderator.video_start_hidden) {
|
if (this._moderator.audio_start_muted && this._moderator.video_start_hidden) {
|
||||||
this.userLog('warning', 'The Moderator disabled your audio and video', 'top-end');
|
this.userLog('warning', 'The Moderator disabled your audio and video', 'top-end');
|
||||||
@@ -4755,6 +4757,13 @@ class RoomClient {
|
|||||||
'top-end',
|
'top-end',
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case 'chat_cant_chatgpt':
|
||||||
|
this.userLog(
|
||||||
|
'info',
|
||||||
|
`${icons.moderator} Moderator: everyone can't chat with ChatGPT ${status}`,
|
||||||
|
'top-end',
|
||||||
|
);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -5532,6 +5541,9 @@ class RoomClient {
|
|||||||
|
|
||||||
switch (peer_id) {
|
switch (peer_id) {
|
||||||
case 'ChatGPT':
|
case 'ChatGPT':
|
||||||
|
if (this._moderator.chat_cant_chatgpt) {
|
||||||
|
return userLog('warning', 'The moderator does not allow you to chat with ChatGPT', 'top-end', 6000);
|
||||||
|
}
|
||||||
isChatGPTOn = true;
|
isChatGPTOn = true;
|
||||||
chatAbout.innerHTML = generateChatAboutHTML(image.chatgpt, 'ChatGPT');
|
chatAbout.innerHTML = generateChatAboutHTML(image.chatgpt, 'ChatGPT');
|
||||||
this.getId('chatGPTMessages').style.display = 'block';
|
this.getId('chatGPTMessages').style.display = 'block';
|
||||||
@@ -5617,6 +5629,10 @@ class RoomClient {
|
|||||||
this._moderator.chat_cant_privately = data.status;
|
this._moderator.chat_cant_privately = data.status;
|
||||||
rc.roomMessage('chat_cant_privately', data.status);
|
rc.roomMessage('chat_cant_privately', data.status);
|
||||||
break;
|
break;
|
||||||
|
case 'chat_cant_chatgpt':
|
||||||
|
this._moderator.chat_cant_chatgpt = data.status;
|
||||||
|
rc.roomMessage('chat_cant_chatgpt', data.status);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ function handleRules(isPresenter) {
|
|||||||
switchEveryoneCantUnhide.checked = lsSettings.moderator_video_cant_unhide;
|
switchEveryoneCantUnhide.checked = lsSettings.moderator_video_cant_unhide;
|
||||||
switchEveryoneCantShareScreen.checked = lsSettings.moderator_screen_cant_share;
|
switchEveryoneCantShareScreen.checked = lsSettings.moderator_screen_cant_share;
|
||||||
switchEveryoneCantChatPrivately.checked = lsSettings.moderator_chat_cant_privately;
|
switchEveryoneCantChatPrivately.checked = lsSettings.moderator_chat_cant_privately;
|
||||||
|
switchEveryoneCantChatChatGPT.checked = lsSettings.moderator_chat_cant_chatgpt;
|
||||||
|
|
||||||
// Update moderator settings...
|
// Update moderator settings...
|
||||||
const moderatorData = {
|
const moderatorData = {
|
||||||
audio_start_muted: switchEveryoneMute.checked,
|
audio_start_muted: switchEveryoneMute.checked,
|
||||||
@@ -151,6 +153,7 @@ function handleRules(isPresenter) {
|
|||||||
video_cant_unhide: switchEveryoneCantUnhide.checked,
|
video_cant_unhide: switchEveryoneCantUnhide.checked,
|
||||||
screen_cant_share: switchEveryoneCantShareScreen.checked,
|
screen_cant_share: switchEveryoneCantShareScreen.checked,
|
||||||
chat_cant_privately: switchEveryoneCantChatPrivately.checked,
|
chat_cant_privately: switchEveryoneCantChatPrivately.checked,
|
||||||
|
chat_cant_chatgpt: switchEveryoneCantChatChatGPT.checked,
|
||||||
};
|
};
|
||||||
rc.updateRoomModeratorALL(moderatorData);
|
rc.updateRoomModeratorALL(moderatorData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -716,6 +716,24 @@ access to use this app.
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr id="everyoneCantChatGPTBtn">
|
||||||
|
<td style="width: auto">
|
||||||
|
<div class="title">
|
||||||
|
<i class="fa-solid fa-robot red"></i>
|
||||||
|
<p>Everyone can't use ChatGPT</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="form-check form-switch form-switch-md">
|
||||||
|
<input
|
||||||
|
id="switchEveryoneCantChatChatGPT"
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
checked
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم