From 4a3df0c7c91b745e52caee4719a4f1bf9b1234fa Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Tue, 22 Oct 2024 12:39:11 +0200 Subject: [PATCH] [mirotalksfu] - fix chat --- app/src/Server.js | 2 +- package.json | 4 ++-- public/js/Room.js | 10 +++++----- public/js/RoomClient.js | 2 +- public/js/WhoAreYou.js | 9 ++++----- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/app/src/Server.js b/app/src/Server.js index 4926a618..6bbddcfa 100644 --- a/app/src/Server.js +++ b/app/src/Server.js @@ -55,7 +55,7 @@ dev dependencies: { * @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.5.96 + * @version 1.5.97 * */ diff --git a/package.json b/package.json index 68b0f349..1ac41c3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalksfu", - "version": "1.5.96", + "version": "1.5.97", "description": "WebRTC SFU browser-based video calls", "main": "Server.js", "scripts": { @@ -57,7 +57,7 @@ "node": ">=18" }, "dependencies": { - "@sentry/node": "^8.34.0", + "@sentry/node": "^8.35.0", "axios": "^1.7.7", "body-parser": "1.20.3", "colors": "1.4.0", diff --git a/public/js/Room.js b/public/js/Room.js index 033b4e92..dd11ae56 100644 --- a/public/js/Room.js +++ b/public/js/Room.js @@ -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.5.96 + * @version 1.5.97 * */ @@ -3932,7 +3932,7 @@ function getParticipantsList(peers) { // CHAT-GPT if (chatGPT) { - const chatgpt_active = rc.chatPeerName === 'ChatGPT' ? ' active' : ''; + const chatgpt_active = !rc.isChatOpen && rc.chatPeerName === 'ChatGPT' ? ' active' : ''; li = `
  • `; } - const public_chat_active = rc.chatPeerName === 'all' ? ' active' : ''; + const public_chat_active = !rc.isChatOpen && rc.chatPeerName === 'all' ? ' active' : ''; // ALL li += ` @@ -4036,7 +4036,7 @@ function getParticipantsList(peers) { const peer_id = peer_info.peer_id; const avatarImg = getParticipantAvatar(peer_name); - const peer_chat_active = rc.chatPeerId === peer_id ? ' active' : ''; + const peer_chat_active = !rc.isChatOpen && rc.chatPeerId === peer_id ? ' active' : ''; // NOT ME if (socket.id !== peer_id) { @@ -4500,7 +4500,7 @@ function showAbout() { imageUrl: image.about, customClass: { image: 'img-about' }, position: 'center', - title: 'WebRTC SFU v1.5.96', + title: 'WebRTC SFU v1.5.97', html: `
    diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index a3ed78d8..5a78b46f 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -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.5.96 + * @version 1.5.97 * */ diff --git a/public/js/WhoAreYou.js b/public/js/WhoAreYou.js index a0933dc8..29ffdfa2 100644 --- a/public/js/WhoAreYou.js +++ b/public/js/WhoAreYou.js @@ -35,11 +35,11 @@ guestJoinRoomBtn.addEventListener('click', () => { // Function to play sound function playSound(name) { if (!settings.sounds) return; - + const soundSrc = `../sounds/${name}.wav`; const audio = new Audio(soundSrc); audio.volume = 0.5; - + audio.play().catch((err) => { console.error(`Error playing sound: ${err}`); }); @@ -63,13 +63,13 @@ async function checkRoomStatus(roomId) { const response = await axios.post('/isRoomActive', { roomId }); const isActive = response.data.message; console.log('Room active status:', isActive); - + roomActive = isActive; if (roomActive) { playSound('roomActive'); guestJoinRoomBtn.classList.remove('disabled'); presenterLoginBtn.style.display = 'none'; - + if (autoJoinRoom) { guestJoinRoomBtn.click(); } @@ -120,4 +120,3 @@ document.addEventListener('visibilitychange', handleVisibilityChange); handleScreenResize(mediaQuery); checkRoomStatus(roomId); startRoomStatusCheck(); -