From dd66e7e1ff882c05765640b3843b4adb8dcc8eca Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sun, 26 Jul 2026 12:27:54 +0200 Subject: [PATCH] Added to Show chat room details Type & Security fields --- webui-src/app/chat/chat.js | 52 +++++++++++++++++++++++++++++ webui-src/app/scss/pages/_chat.scss | 2 +- webui-src/styles.css | 2 +- 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/webui-src/app/chat/chat.js b/webui-src/app/chat/chat.js index d25ed43..6f27b49 100644 --- a/webui-src/app/chat/chat.js +++ b/webui-src/app/chat/chat.js @@ -936,6 +936,46 @@ const ChatConversationView = () => { // ***************************** Page Layouts ****************************** +function getLobbyPrivacyInfo(room) { + if (!room) return { type: 'Public', security: 'Anonymous IDs accepted' }; + + const flags = + room.lobby_privacy_type !== undefined + ? room.lobby_privacy_type + : room.lobby_privacy_level !== undefined + ? room.lobby_privacy_level + : room.privacy_type !== undefined + ? room.privacy_type + : room.lobby_privacy !== undefined + ? room.lobby_privacy + : room.privacy_level !== undefined + ? room.privacy_level + : room.lobby_flags !== undefined + ? room.lobby_flags + : 0; + + let isPublic = + (flags & 4) !== 0 || + (flags & 1) !== 0 || + ChatHubState.selectedRoomType === 'public' || + room.is_public === true; + + if (flags === 1 || flags === 2) { + if ((flags & 1) === 1 && (flags & 4) === 0 && ChatHubState.selectedRoomType !== 'public') { + isPublic = false; + } + } + + const typeStr = isPublic ? 'Public' : 'Private'; + const isAuthOnly = (flags & 8) !== 0; + const securityStr = isAuthOnly ? 'No anonymous IDs' : 'Anonymous IDs accepted'; + + return { + type: typeStr, + security: securityStr, + }; +} + const ChatRoomDetailView = () => { return { view: () => { @@ -976,6 +1016,8 @@ const ChatRoomDetailView = () => { participantNames.sort((a, b) => a.localeCompare(b)); const lobbyHexId = rs.idToHex(room.lobby_id); + const privacy = getLobbyPrivacyInfo(room); + return m('.chat-room-detail-view', [ m('.detail-section', [ @@ -985,6 +1027,10 @@ const ChatRoomDetailView = () => { m('.info-value', room.lobby_name || ''), m('.info-label', 'Topic'), m('.info-value', room.lobby_topic || 'None'), + m('.info-label', 'Type'), + m('.info-value', privacy.type), + m('.info-label', 'Security'), + m('.info-value', privacy.security), m('.info-label', 'Participants'), m('.info-value', participantCount + ' users'), m('.info-label', 'Your Identity'), @@ -1020,6 +1066,7 @@ const ChatRoomJoinView = () => { const lobbyHexId = rs.idToHex(room.lobby_id); const participantCount = room.total_number_of_peers || 0; + const privacy = getLobbyPrivacyInfo(room); return m('.chat-room-detail-view', [ m('.detail-section', [ @@ -1029,11 +1076,16 @@ const ChatRoomJoinView = () => { m('.info-value', room.lobby_name || ''), m('.info-label', 'Topic'), m('.info-value', room.lobby_topic || 'None'), + m('.info-label', 'Type'), + m('.info-value', privacy.type), + m('.info-label', 'Security'), + m('.info-value', privacy.security), m('.info-label', 'Participants'), m('.info-value', participantCount + ' users'), ]), ]), + m('.detail-section', [ m('h3', 'Join Room'), m('p.join-description', 'Select an identity to join this chat room:'), diff --git a/webui-src/app/scss/pages/_chat.scss b/webui-src/app/scss/pages/_chat.scss index 3714e0e..5226f76 100644 --- a/webui-src/app/scss/pages/_chat.scss +++ b/webui-src/app/scss/pages/_chat.scss @@ -499,7 +499,7 @@ textarea.chatMsg { align-items: center; justify-content: center; color: #ffffff; - font-size: 0.85rem; + font-size: 1.35rem; } &.public-room .room-icon { diff --git a/webui-src/styles.css b/webui-src/styles.css index 55041c2..ef5e989 100644 --- a/webui-src/styles.css +++ b/webui-src/styles.css @@ -1010,7 +1010,7 @@ h1{font-size:3rem}h2{font-size:2.25rem}h3{font-size:1.875rem}h4{font-size:1.5rem align-items: center; justify-content: center; color: #ffffff; - font-size: 0.85rem; + font-size: 1.35rem; } .chat-room-list-item.public-room .room-icon {