Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
make FederationClient.send_invite async
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Feb 3, 2020
1 parent 4b4536d commit ea23210
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,23 +659,22 @@ async def _do_send_join(self, destination: str, pdu: EventBase):
# content.
return resp[1]

@defer.inlineCallbacks
def send_invite(self, destination, room_id, event_id, pdu):
room_version = yield self.store.get_room_version_id(room_id)
async def send_invite(self, destination, room_id, event_id, pdu):
room_version = await self.store.get_room_version_id(room_id)

content = yield self._do_send_invite(destination, pdu, room_version)
content = await self._do_send_invite(destination, pdu, room_version)

pdu_dict = content["event"]

logger.debug("Got response to send_invite: %s", pdu_dict)

room_version = yield self.store.get_room_version_id(room_id)
room_version = await self.store.get_room_version_id(room_id)
format_ver = room_version_to_event_format(room_version)

pdu = event_from_pdu_json(pdu_dict, format_ver)

# Check signatures are correct.
pdu = yield self._check_sigs_and_hash(room_version, pdu)
pdu = await self._check_sigs_and_hash(room_version, pdu)

# FIXME: We should handle signature failures more gracefully.

Expand Down

0 comments on commit ea23210

Please sign in to comment.