mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Use current state to get room hosts, rather than querying the database
This commit is contained in:
parent
02c3b1c9e2
commit
07286a73b1
2 changed files with 32 additions and 7 deletions
|
@ -376,10 +376,23 @@ class FederationHandler(BaseHandler):
|
|||
"user_joined_room", user=user, room_id=event.room_id
|
||||
)
|
||||
|
||||
new_pdu = self.pdu_codec.pdu_from_event(event);
|
||||
new_pdu.destinations = yield self.store.get_joined_hosts_for_room(
|
||||
event.room_id
|
||||
)
|
||||
new_pdu = self.pdu_codec.pdu_from_event(event)
|
||||
|
||||
destinations = set()
|
||||
|
||||
for k, s in event.state_events.items():
|
||||
try:
|
||||
if k[0] == RoomMemberEvent.TYPE:
|
||||
if s.content["membership"] == Membership.JOIN:
|
||||
destinations.add(
|
||||
self.hs.parse_userid(s.state_key).domain
|
||||
)
|
||||
except:
|
||||
logger.warn(
|
||||
"Failed to get destination from event %s", s.event_id
|
||||
)
|
||||
|
||||
new_pdu.destinations = list(destinations)
|
||||
|
||||
yield self.replication_layer.send_pdu(new_pdu)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue