mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 01:14:48 -04:00
Use get_joined_users_from_context instead of manually looking up hosts
This commit is contained in:
parent
940d4fad24
commit
69a2d4e38c
2 changed files with 17 additions and 46 deletions
|
@ -832,11 +832,13 @@ class FederationHandler(BaseHandler):
|
|||
|
||||
new_pdu = event
|
||||
|
||||
message_handler = self.hs.get_handlers().message_handler
|
||||
destinations = yield message_handler.get_joined_hosts_for_room_from_state(
|
||||
context
|
||||
users_in_room = yield self.store.get_joined_users_from_context(event, context)
|
||||
|
||||
destinations = set(
|
||||
get_domain_from_id(user_id) for user_id in users_in_room
|
||||
if not self.hs.is_mine_id(user_id)
|
||||
)
|
||||
destinations = set(destinations)
|
||||
|
||||
destinations.discard(origin)
|
||||
|
||||
logger.debug(
|
||||
|
@ -1055,11 +1057,12 @@ class FederationHandler(BaseHandler):
|
|||
|
||||
new_pdu = event
|
||||
|
||||
message_handler = self.hs.get_handlers().message_handler
|
||||
destinations = yield message_handler.get_joined_hosts_for_room_from_state(
|
||||
context
|
||||
users_in_room = yield self.store.get_joined_users_from_context(event, context)
|
||||
|
||||
destinations = set(
|
||||
get_domain_from_id(user_id) for user_id in users_in_room
|
||||
if not self.hs.is_mine_id(user_id)
|
||||
)
|
||||
destinations = set(destinations)
|
||||
destinations.discard(origin)
|
||||
|
||||
logger.debug(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue