Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 4911f79

Browse files
authored
Remove support for unstable MSC1772 prefixes. (#10161)
The stable prefixes have been supported since v1.34.0. The unstable prefixes are not supported by any known clients.
1 parent 9e5ab6d commit 4911f79

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

changelog.d/10161.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Stop supporting the unstable spaces prefixes from MSC1772.

synapse/api/constants.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ class EventTypes:
112112

113113
SpaceChild = "m.space.child"
114114
SpaceParent = "m.space.parent"
115-
MSC1772_SPACE_CHILD = "org.matrix.msc1772.space.child"
116-
MSC1772_SPACE_PARENT = "org.matrix.msc1772.space.parent"
117115

118116

119117
class ToDeviceEventTypes:
@@ -180,7 +178,6 @@ class EventContentFields:
180178

181179
# cf https://github.com/matrix-org/matrix-doc/pull/1772
182180
ROOM_TYPE = "type"
183-
MSC1772_ROOM_TYPE = "org.matrix.msc1772.type"
184181

185182

186183
class RoomEncryptionAlgorithms:

synapse/handlers/space_summary.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,7 @@ async def _summarize_remote_room(
402402
return (), ()
403403

404404
return res.rooms, tuple(
405-
ev.data
406-
for ev in res.events
407-
if ev.event_type == EventTypes.MSC1772_SPACE_CHILD
408-
or ev.event_type == EventTypes.SpaceChild
405+
ev.data for ev in res.events if ev.event_type == EventTypes.SpaceChild
409406
)
410407

411408
async def _is_room_accessible(
@@ -514,11 +511,6 @@ async def _build_room_entry(self, room_id: str) -> JsonDict:
514511
current_state_ids[(EventTypes.Create, "")]
515512
)
516513

517-
# TODO: update once MSC1772 lands
518-
room_type = create_event.content.get(EventContentFields.ROOM_TYPE)
519-
if not room_type:
520-
room_type = create_event.content.get(EventContentFields.MSC1772_ROOM_TYPE)
521-
522514
room_version = await self._store.get_room_version(room_id)
523515
allowed_spaces = None
524516
if await self._event_auth_handler.has_restricted_join_rules(
@@ -540,7 +532,7 @@ async def _build_room_entry(self, room_id: str) -> JsonDict:
540532
),
541533
"guest_can_join": stats["guest_access"] == "can_join",
542534
"creation_ts": create_event.origin_server_ts,
543-
"room_type": room_type,
535+
"room_type": create_event.content.get(EventContentFields.ROOM_TYPE),
544536
"allowed_spaces": allowed_spaces,
545537
}
546538

@@ -569,9 +561,7 @@ async def _get_child_events(self, room_id: str) -> Iterable[EventBase]:
569561
[
570562
event_id
571563
for key, event_id in current_state_ids.items()
572-
# TODO: update once MSC1772 has been FCP for a period of time.
573-
if key[0] == EventTypes.MSC1772_SPACE_CHILD
574-
or key[0] == EventTypes.SpaceChild
564+
if key[0] == EventTypes.SpaceChild
575565
]
576566
)
577567

0 commit comments

Comments
 (0)