Update get_users_in_room mis-use to get hosts with dedicated get_current_hosts_in_room (#13605)

See https://github.com/matrix-org/synapse/pull/13575#discussion_r953023755
This commit is contained in:
Eric Eastwood 2022-08-24 14:15:37 -05:00 committed by GitHub
parent d58615c82c
commit 1a209efdb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 17 deletions

View file

@ -26,7 +26,7 @@ from synapse.metrics.background_process_metrics import (
)
from synapse.replication.tcp.streams import TypingStream
from synapse.streams import EventSource
from synapse.types import JsonDict, Requester, StreamKeyType, UserID, get_domain_from_id
from synapse.types import JsonDict, Requester, StreamKeyType, UserID
from synapse.util.caches.stream_change_cache import StreamChangeCache
from synapse.util.metrics import Measure
from synapse.util.wheel_timer import WheelTimer
@ -362,8 +362,9 @@ class TypingWriterHandler(FollowerTypingHandler):
)
return
users = await self.store.get_users_in_room(room_id)
domains = {get_domain_from_id(u) for u in users}
domains = await self._storage_controllers.state.get_current_hosts_in_room(
room_id
)
if self.server_name in domains:
logger.info("Got typing update from %s: %r", user_id, content)