make FederationHandler.send_invite async
This commit is contained in:
parent
e81c093974
commit
5d17c31596
|
@ -1184,13 +1184,12 @@ class FederationHandler(BaseHandler):
|
||||||
)
|
)
|
||||||
raise SynapseError(http_client.BAD_REQUEST, "Too many auth_events")
|
raise SynapseError(http_client.BAD_REQUEST, "Too many auth_events")
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
async def send_invite(self, target_host, event):
|
||||||
def send_invite(self, target_host, event):
|
|
||||||
""" Sends the invite to the remote server for signing.
|
""" Sends the invite to the remote server for signing.
|
||||||
|
|
||||||
Invites must be signed by the invitee's server before distribution.
|
Invites must be signed by the invitee's server before distribution.
|
||||||
"""
|
"""
|
||||||
pdu = yield self.federation_client.send_invite(
|
pdu = await self.federation_client.send_invite(
|
||||||
destination=target_host,
|
destination=target_host,
|
||||||
room_id=event.room_id,
|
room_id=event.room_id,
|
||||||
event_id=event.event_id,
|
event_id=event.event_id,
|
||||||
|
|
|
@ -932,10 +932,9 @@ class EventCreationHandler(object):
|
||||||
# way? If we have been invited by a remote server, we need
|
# way? If we have been invited by a remote server, we need
|
||||||
# to get them to sign the event.
|
# to get them to sign the event.
|
||||||
|
|
||||||
returned_invite = yield federation_handler.send_invite(
|
returned_invite = yield defer.ensureDeferred(
|
||||||
invitee.domain, event
|
federation_handler.send_invite(invitee.domain, event)
|
||||||
)
|
)
|
||||||
|
|
||||||
event.unsigned.pop("room_state", None)
|
event.unsigned.pop("room_state", None)
|
||||||
|
|
||||||
# TODO: Make sure the signatures actually are correct.
|
# TODO: Make sure the signatures actually are correct.
|
||||||
|
|
Loading…
Reference in New Issue