[mirotalksfu] - #148 add chatGPT in chat config section

هذا الالتزام موجود في:
Miroslav Pejic
2024-03-18 22:08:55 +01:00
الأصل 1e0522b4a4
التزام 1ba6967e2b
4 ملفات معدلة مع 46 إضافات و39 حذوفات

عرض الملف

@@ -43,6 +43,27 @@ module.exports = class Room {
this.createTheRouter();
}
// ####################################################
// ROOM INFO
// ####################################################
toJson() {
return {
id: this.id,
broadcasting: this._isBroadcasting,
recSyncServerRecording: this._recSyncServerRecording,
config: {
isLocked: this._isLocked,
isLobbyEnabled: this._isLobbyEnabled,
hostOnlyRecording: this._hostOnlyRecording,
},
moderator: this._moderator,
survey: this.survey,
redirect: this.redirect,
peers: JSON.stringify([...this.peers]),
};
}
// ####################################################
// ROUTER
// ####################################################
@@ -163,27 +184,6 @@ module.exports = class Room {
}
}
// ####################################################
// ROOM INFO
// ####################################################
toJson() {
return {
id: this.id,
broadcasting: this._isBroadcasting,
recSyncServerRecording: this._recSyncServerRecording,
config: {
isLocked: this._isLocked,
isLobbyEnabled: this._isLobbyEnabled,
hostOnlyRecording: this._hostOnlyRecording,
},
moderator: this._moderator,
survey: this.survey,
redirect: this.redirect,
peers: JSON.stringify([...this.peers]),
};
}
// ####################################################
// PEERS
// ####################################################

عرض الملف

@@ -181,6 +181,7 @@ module.exports = {
chatEmojiButton: true,
chatMarkdownButton: true,
chatSpeechStartButton: true,
chatGPT: true,
},
participantsList: {
saveInfoButton: true, // presenter

عرض الملف

@@ -3390,25 +3390,30 @@ async function getRoomParticipants() {
}
function getParticipantsList(peers) {
let li = '';
const chatGPT = BUTTONS.chat.chatGPT !== undefined ? BUTTONS.chat.chatGPT : true;
// CHAT-GPT
let li = `
<li
id="ChatGPT"
data-to-id="ChatGPT"
data-to-name="ChatGPT"
class="clearfix"
onclick="rc.showPeerAboutAndMessages(this.id, 'ChatGPT', event)"
>
<img
src="${image.chatgpt}"
alt="avatar"
/>
<div class="about">
<div class="name">ChatGPT</div>
<div class="status"><i class="fa fa-circle online"></i> online</div>
</div>
</li>
`;
if (chatGPT) {
li = `
<li
id="ChatGPT"
data-to-id="ChatGPT"
data-to-name="ChatGPT"
class="clearfix"
onclick="rc.showPeerAboutAndMessages(this.id, 'ChatGPT', event)"
>
<img
src="${image.chatgpt}"
alt="avatar"
/>
<div class="about">
<div class="name">ChatGPT</div>
<div class="status"><i class="fa fa-circle online"></i> online</div>
</div>
</li>`;
}
// ALL
li += `

عرض الملف

@@ -81,6 +81,7 @@ let BUTTONS = {
chatEmojiButton: true,
chatMarkdownButton: true,
chatSpeechStartButton: true,
chatGPT: true,
},
participantsList: {
saveInfoButton: true, // presenter