mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 12:35:01 -04:00
Do not propagate typing notifications from shadow-banned users. (#8176)
This commit is contained in:
parent
e0d6244beb
commit
6fe12c9512
6 changed files with 102 additions and 24 deletions
|
@ -868,17 +868,21 @@ class RoomTypingRestServlet(RestServlet):
|
|||
# Limit timeout to stop people from setting silly typing timeouts.
|
||||
timeout = min(content.get("timeout", 30000), 120000)
|
||||
|
||||
if content["typing"]:
|
||||
await self.typing_handler.started_typing(
|
||||
target_user=target_user,
|
||||
auth_user=requester.user,
|
||||
room_id=room_id,
|
||||
timeout=timeout,
|
||||
)
|
||||
else:
|
||||
await self.typing_handler.stopped_typing(
|
||||
target_user=target_user, auth_user=requester.user, room_id=room_id
|
||||
)
|
||||
try:
|
||||
if content["typing"]:
|
||||
await self.typing_handler.started_typing(
|
||||
target_user=target_user,
|
||||
requester=requester,
|
||||
room_id=room_id,
|
||||
timeout=timeout,
|
||||
)
|
||||
else:
|
||||
await self.typing_handler.stopped_typing(
|
||||
target_user=target_user, requester=requester, room_id=room_id
|
||||
)
|
||||
except ShadowBanError:
|
||||
# Pretend this worked without error.
|
||||
pass
|
||||
|
||||
return 200, {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue