mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-22 17:46:08 +03:00
make FederationClient.send_leave async
This commit is contained in:
parent
8af9f11bea
commit
a46fabf17b
1 changed files with 9 additions and 10 deletions
|
@ -730,7 +730,7 @@ class FederationClient(FederationBase):
|
||||||
)
|
)
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def send_leave(self, destinations, pdu):
|
async def send_leave(self, destinations: Iterable[str], pdu: EventBase) -> None:
|
||||||
"""Sends a leave event to one of a list of homeservers.
|
"""Sends a leave event to one of a list of homeservers.
|
||||||
|
|
||||||
Doing so will cause the remote server to add the event to the graph,
|
Doing so will cause the remote server to add the event to the graph,
|
||||||
|
@ -739,17 +739,14 @@ class FederationClient(FederationBase):
|
||||||
This is mostly useful to reject received invites.
|
This is mostly useful to reject received invites.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
destinations (str): Candidate homeservers which are probably
|
destinations: Candidate homeservers which are probably
|
||||||
participating in the room.
|
participating in the room.
|
||||||
pdu (BaseEvent): event to be sent
|
pdu: event to be sent
|
||||||
|
|
||||||
Return:
|
Raises:
|
||||||
Deferred: resolves to None.
|
SynapseError if the chosen remote server returns a 300/400 code.
|
||||||
|
|
||||||
Fails with a ``SynapseError`` if the chosen remote server
|
RuntimeError if no servers were reachable.
|
||||||
returns a 300/400 code.
|
|
||||||
|
|
||||||
Fails with a ``RuntimeError`` if no servers were reachable.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
@ -759,7 +756,9 @@ class FederationClient(FederationBase):
|
||||||
logger.debug("Got content: %s", content)
|
logger.debug("Got content: %s", content)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return self._try_destination_list("send_leave", destinations, send_request)
|
return await self._try_destination_list(
|
||||||
|
"send_leave", destinations, send_request
|
||||||
|
)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _do_send_leave(self, destination, pdu):
|
def _do_send_leave(self, destination, pdu):
|
||||||
|
|
Loading…
Reference in a new issue