realtime: emit and handle chat_deleted for full chat removals
All checks were successful
CI / test (push) Successful in 38s
All checks were successful
CI / test (push) Successful in 38s
This commit is contained in:
@@ -20,6 +20,7 @@ RealtimeEventName = Literal[
|
||||
"user_online",
|
||||
"user_offline",
|
||||
"chat_updated",
|
||||
"chat_deleted",
|
||||
"pong",
|
||||
"error",
|
||||
]
|
||||
|
||||
@@ -162,6 +162,13 @@ class RealtimeGateway:
|
||||
payload={"chat_id": chat_id},
|
||||
)
|
||||
|
||||
async def publish_chat_deleted(self, *, chat_id: int) -> None:
|
||||
await self._publish_chat_event(
|
||||
chat_id,
|
||||
event="chat_deleted",
|
||||
payload={"chat_id": chat_id},
|
||||
)
|
||||
|
||||
async def disconnect_user(self, user_id: int, *, code: int = 4401, reason: str = "Session revoked") -> None:
|
||||
user_connections = self._connections.get(user_id, {})
|
||||
if not user_connections:
|
||||
|
||||
Reference in New Issue
Block a user