summary refs log tree commit diff
path: root/synapse/federation/transport/client.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-23 18:14:20 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-23 18:14:20 +0100
commitcb6c2caf05a80ea85a0336695ccdfbebc4ac36c9 (patch)
treec9a40122c1d1a81ca8048d9c06cc0d28d78d94d5 /synapse/federation/transport/client.py
parentMerge commit '4ecba9bd5' into anoa/dinsic_release_1_31_0 (diff)
parentSpaces summary: call out to other servers (#9653) (diff)
downloadsynapse-cb6c2caf05a80ea85a0336695ccdfbebc4ac36c9.tar.xz
Merge commit 'c73cc2c2a' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/federation/transport/client.py')
-rw-r--r--synapse/federation/transport/client.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/synapse/federation/transport/client.py b/synapse/federation/transport/client.py

index 3f2b2bf7d5..df7e9fbbc2 100644 --- a/synapse/federation/transport/client.py +++ b/synapse/federation/transport/client.py
@@ -1031,6 +1031,38 @@ class TransportLayerClient: return self.client.get_json(destination=destination, path=path) + async def get_space_summary( + self, + destination: str, + room_id: str, + suggested_only: bool, + max_rooms_per_space: Optional[int], + exclude_rooms: List[str], + ) -> JsonDict: + """ + Args: + destination: The remote server + room_id: The room ID to ask about. + suggested_only: if True, only suggested rooms will be returned + max_rooms_per_space: an optional limit to the number of children to be + returned per space + exclude_rooms: a list of any rooms we can skip + """ + path = _create_path( + FEDERATION_UNSTABLE_PREFIX, "/org.matrix.msc2946/spaces/%s", room_id + ) + + params = { + "suggested_only": suggested_only, + "exclude_rooms": exclude_rooms, + } + if max_rooms_per_space is not None: + params["max_rooms_per_space"] = max_rooms_per_space + + return await self.client.post_json( + destination=destination, path=path, data=params + ) + def get_info_of_users(self, destination: str, user_ids: List[str]): """ Args: