From 65979da07cabbd3d4a71da83b92ef0ec2f9704ae Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Tue, 31 Mar 2026 09:29:39 +0200 Subject: [PATCH] [mirotalk] #240 - show pinned participants list on incoming private messages --- public/js/client.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/public/js/client.js b/public/js/client.js index a843e21a..0174dca5 100644 --- a/public/js/client.js +++ b/public/js/client.js @@ -6079,10 +6079,7 @@ function setParticipantsBtn() { chatPin(); } - msgerDraggable.classList.add('msger-pinned-sidebar-open'); - msgerCPBtn.classList.add('active'); - searchPeerBarName?.focus(); - screenReaderAccessibility.announceMessage('Pinned chat participants opened'); + openPinnedParticipantsSidebar(true); return; } @@ -6092,6 +6089,20 @@ function setParticipantsBtn() { }); } +function openPinnedParticipantsSidebar(announce = false) { + if (!isChatPinned) { + return; + } + + msgerDraggable.classList.add('msger-pinned-sidebar-open'); + msgerCPBtn.classList.add('active'); + searchPeerBarName?.focus(); + + if (announce) { + screenReaderAccessibility.announceMessage('Pinned chat participants opened'); + } +} + /** * Caption room buttons click event */ @@ -9860,6 +9871,10 @@ function handleDataChannelChat(dataMessage) { if (msgPrivate) { if (!isConversationCurrentlyVisible('private', msgFrom, msgFromId)) { addUnreadMessage('private', msgFromId); + + if (isChatRoomVisible && isChatPinned) { + openPinnedParticipantsSidebar(); + } } } else if (!isConversationCurrentlyVisible('public')) { addUnreadMessage('public');