mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 14:45:01 -04:00
Ignore EDUs for rooms we're not in (#10317)
This commit is contained in:
parent
bcb0962a72
commit
47e28b4031
4 changed files with 67 additions and 0 deletions
|
@ -208,6 +208,7 @@ class TypingWriterHandler(FollowerTypingHandler):
|
|||
|
||||
self.auth = hs.get_auth()
|
||||
self.notifier = hs.get_notifier()
|
||||
self.event_auth_handler = hs.get_event_auth_handler()
|
||||
|
||||
self.hs = hs
|
||||
|
||||
|
@ -326,6 +327,19 @@ class TypingWriterHandler(FollowerTypingHandler):
|
|||
room_id = content["room_id"]
|
||||
user_id = content["user_id"]
|
||||
|
||||
# If we're not in the room just ditch the event entirely. This is
|
||||
# probably an old server that has come back and thinks we're still in
|
||||
# the room (or we've been rejoined to the room by a state reset).
|
||||
is_in_room = await self.event_auth_handler.check_host_in_room(
|
||||
room_id, self.server_name
|
||||
)
|
||||
if not is_in_room:
|
||||
logger.info(
|
||||
"Ignoring typing update from %s as we're not in the room",
|
||||
origin,
|
||||
)
|
||||
return
|
||||
|
||||
member = RoomMember(user_id=user_id, room_id=room_id)
|
||||
|
||||
# Check that the string is a valid user id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue