From 291e79c41f62c1636c5a502b93f1abf7f1428e49 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Fri, 27 Mar 2026 14:46:08 +0100 Subject: [PATCH] fix(chat): improve room announcement logic in MultiChatDialog.vue - Enhanced the logic for announcing room entries, particularly in adult-only mode, to ensure accurate messaging based on room selection. - Added checks to prevent redundant announcements and ensure proper synchronization with the selected room. --- frontend/src/dialogues/chat/MultiChatDialog.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/dialogues/chat/MultiChatDialog.vue b/frontend/src/dialogues/chat/MultiChatDialog.vue index 9146e4d..024a04f 100644 --- a/frontend/src/dialogues/chat/MultiChatDialog.vue +++ b/frontend/src/dialogues/chat/MultiChatDialog.vue @@ -1179,6 +1179,12 @@ export default { if (this.joinFallbackTimer) { clearTimeout(this.joinFallbackTimer); this.joinFallbackTimer = null; } const actualRoom = msg.to || msg.room || msg.roomName || ''; const desiredRoom = this.resolveInitialRoomName(); + if (actualRoom) { + const matchingRoom = this.rooms.find((room) => (room.title || room.name) === actualRoom); + if (matchingRoom) { + this.selectedRoom = matchingRoom.id; + } + } if ( this.adultOnlyMode && desiredRoom @@ -1194,13 +1200,15 @@ export default { return; } // Eigene Beitrittsmeldung einmalig mit Raumname anzeigen - if (!this.announcedRoomEnter) { + if (!this.announcedRoomEnter || (this.adultOnlyMode && actualRoom && desiredRoom && actualRoom === desiredRoom)) { const room = actualRoom || this.getSelectedRoomName(); if (room) { const text = this.$t('chat.multichat.system.room_entered', { room }); this.messages.push({ id: msg.id || Date.now(), user: 'System', text }); } - this.announcedRoomEnter = true; + if (!this.adultOnlyMode || !desiredRoom || actualRoom === desiredRoom) { + this.announcedRoomEnter = true; + } } return; }