fix: someone removed from a group keeps a chat shared with that group open (#32535)

When an admin took someone out of a group, a chat shared with that group with "Allow replies" stayed open on that person's screen, message box included. Changing a group drops that person's live connection, and when it came back the chat was only checked again if the server let them back in, so a refused rejoin left the page as it was. Now the chat is checked again after every answer, so someone who lost access is sent to the home page.

Fixes #32527
This commit is contained in:
Classic298 authored and GitHub committed 2026-10-16 14:16:03 +04:00
1 parent 291b57bec2
commit df5fc0c14f
1 file changed
+3 -2
+3 -2
View File
@@ -1464,8 +1464,9 @@
if (next && socket)
socket.emit('events:chat', { chat_id: next, data: { type: 'join' } }, (accepted: boolean) => {
if (!socket.connected || socket.id !== connectionId || $chatId !== next) return;
if (accepted) void refreshChat();
else clearPresence();
if (!accepted) clearPresence();
// A refused join can mean access was lost; the refresh then sends the reader home.
void refreshChat();
});
};
$: syncChatRoom($socket, $chatId, $temporaryChatEnabled);