refac: recheck live chat access after archiving and bulk unsharing (#32887)

Archiving a chat, archiving all chats and unsharing all chats now run the same live access recheck as the other chat changes.
This commit is contained in:
Classic298 2026-10-22 01:32:51 +02:00 • committed by GitHub
parent a9adb2b78e
commit ed3cf83553
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1136,8 +1136,11 @@ class SocketSessionEventSink:
EVENTS.CHAT_UNSHARED.name,
EVENTS.CHAT_FOLDER_UPDATED.name,
EVENTS.CHAT_DELETED.name,
EVENTS.CHAT_ARCHIVED.name,
}:
await refresh_chat_access((event.subject or {}).get('id'))
subject = event.subject or {}
# User-scoped events (archive all, unshare all) recheck every chat.
await refresh_chat_access(subject.get('id') if subject.get('type') == 'chat' else None)
if event.event not in {EVENTS.USER_DELETED.name, EVENTS.USER_ROLE_UPDATED.name}:
return