Skip to content

Commit 582f976

Browse files
authored
Unprefix room_version & encryption from hierarchy API (#19576)
These seem to work properly in the hierarchy API so I figured I'd unprefix them and remove the flag requirement. This should [better align with the spec](https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1roomsroomidhierarchy_response-200_spacehierarchyroomschunk) and Matrix v1.15 (via [MSC3266](matrix-org/matrix-spec-proposals#3266)), which says these properties are available and named like this. Related to #18731. This doesn't affect the stability or experimental flags of the room summary API, just the hierarchy API.
1 parent 70c6796 commit 582f976

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

changelog.d/19576.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Stabilize `room_version` and `encryption` fields in the space/room `/hierarchy` API (part of [MSC3266](https://github.com/matrix-org/matrix-spec-proposals/pull/3266)).

synapse/handlers/room_summary.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ def __init__(self, hs: "HomeServer"):
128128
name="get_room_hierarchy",
129129
server_name=self.server_name,
130130
)
131-
self._msc3266_enabled = hs.config.experimental.msc3266_enabled
132131

133132
async def get_room_hierarchy(
134133
self,
@@ -791,6 +790,7 @@ async def _build_room_entry(self, room_id: str, for_federation: bool) -> JsonDic
791790

792791
entry: JsonDict = {
793792
"room_id": stats.room_id,
793+
"room_version": stats.version,
794794
"name": stats.name,
795795
"topic": stats.topic,
796796
"canonical_alias": stats.canonical_alias,
@@ -802,12 +802,9 @@ async def _build_room_entry(self, room_id: str, for_federation: bool) -> JsonDic
802802
),
803803
"guest_can_join": stats.guest_access == "can_join",
804804
"room_type": stats.room_type,
805+
"encryption": stats.encryption,
805806
}
806807

807-
if self._msc3266_enabled:
808-
entry["im.nheko.summary.version"] = stats.version
809-
entry["im.nheko.summary.encryption"] = stats.encryption
810-
811808
# Federation requests need to provide additional information so the
812809
# requested server is able to filter the response appropriately.
813810
if for_federation:

0 commit comments

Comments
 (0)