diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index 137cfb3346..15a9a88302 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -1014,7 +1014,11 @@ class FederationClient(FederationBase):
)
async def send_join(
- self, destinations: Iterable[str], pdu: EventBase, room_version: RoomVersion
+ self,
+ destinations: Iterable[str],
+ pdu: EventBase,
+ room_version: RoomVersion,
+ partial_state: bool = True,
) -> SendJoinResult:
"""Sends a join event to one of a list of homeservers.
@@ -1027,6 +1031,10 @@ class FederationClient(FederationBase):
pdu: event to be sent
room_version: the version of the room (according to the server that
did the make_join)
+ partial_state: whether to ask the remote server to omit membership state
+ events from the response. If the remote server complies,
+ `partial_state` in the send join result will be set. Defaults to
+ `True`.
Returns:
The result of the send join request.
@@ -1037,7 +1045,9 @@ class FederationClient(FederationBase):
"""
async def send_request(destination: str) -> SendJoinResult:
- response = await self._do_send_join(room_version, destination, pdu)
+ response = await self._do_send_join(
+ room_version, destination, pdu, omit_members=partial_state
+ )
# If an event was returned (and expected to be returned):
#
@@ -1142,9 +1152,9 @@ class FederationClient(FederationBase):
% (auth_chain_create_events,)
)
- if response.partial_state and not response.servers_in_room:
+ if response.members_omitted and not response.servers_in_room:
raise InvalidResponseError(
- "partial_state was set, but no servers were listed in the room"
+ "members_omitted was set, but no servers were listed in the room"
)
return SendJoinResult(
@@ -1152,7 +1162,7 @@ class FederationClient(FederationBase):
state=signed_state,
auth_chain=signed_auth,
origin=destination,
- partial_state=response.partial_state,
+ partial_state=response.members_omitted,
servers_in_room=response.servers_in_room or [],
)
@@ -1177,7 +1187,11 @@ class FederationClient(FederationBase):
)
async def _do_send_join(
- self, room_version: RoomVersion, destination: str, pdu: EventBase
+ self,
+ room_version: RoomVersion,
+ destination: str,
+ pdu: EventBase,
+ omit_members: bool,
) -> SendJoinResponse:
time_now = self._clock.time_msec()
@@ -1188,6 +1202,7 @@ class FederationClient(FederationBase):
room_id=pdu.room_id,
event_id=pdu.event_id,
content=pdu.get_pdu_json(time_now),
+ omit_members=omit_members,
)
except HttpResponseException as e:
# If an error is received that is due to an unrecognised endpoint,
|