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

Commit

Permalink
Remove support for unstable MSC1772 prefixes. (#10161)
Browse files Browse the repository at this point in the history
The stable prefixes have been supported since v1.34.0. The unstable
prefixes are not supported by any known clients.
  • Loading branch information
clokep committed Jun 15, 2021
1 parent 9e5ab6d commit 4911f79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
1 change: 1 addition & 0 deletions changelog.d/10161.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop supporting the unstable spaces prefixes from MSC1772.
3 changes: 0 additions & 3 deletions synapse/api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ class EventTypes:

SpaceChild = "m.space.child"
SpaceParent = "m.space.parent"
MSC1772_SPACE_CHILD = "org.matrix.msc1772.space.child"
MSC1772_SPACE_PARENT = "org.matrix.msc1772.space.parent"


class ToDeviceEventTypes:
Expand Down Expand Up @@ -180,7 +178,6 @@ class EventContentFields:

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


class RoomEncryptionAlgorithms:
Expand Down
16 changes: 3 additions & 13 deletions synapse/handlers/space_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,7 @@ async def _summarize_remote_room(
return (), ()

return res.rooms, tuple(
ev.data
for ev in res.events
if ev.event_type == EventTypes.MSC1772_SPACE_CHILD
or ev.event_type == EventTypes.SpaceChild
ev.data for ev in res.events if ev.event_type == EventTypes.SpaceChild
)

async def _is_room_accessible(
Expand Down Expand Up @@ -514,11 +511,6 @@ async def _build_room_entry(self, room_id: str) -> JsonDict:
current_state_ids[(EventTypes.Create, "")]
)

# TODO: update once MSC1772 lands
room_type = create_event.content.get(EventContentFields.ROOM_TYPE)
if not room_type:
room_type = create_event.content.get(EventContentFields.MSC1772_ROOM_TYPE)

room_version = await self._store.get_room_version(room_id)
allowed_spaces = None
if await self._event_auth_handler.has_restricted_join_rules(
Expand All @@ -540,7 +532,7 @@ async def _build_room_entry(self, room_id: str) -> JsonDict:
),
"guest_can_join": stats["guest_access"] == "can_join",
"creation_ts": create_event.origin_server_ts,
"room_type": room_type,
"room_type": create_event.content.get(EventContentFields.ROOM_TYPE),
"allowed_spaces": allowed_spaces,
}

Expand Down Expand Up @@ -569,9 +561,7 @@ async def _get_child_events(self, room_id: str) -> Iterable[EventBase]:
[
event_id
for key, event_id in current_state_ids.items()
# TODO: update once MSC1772 has been FCP for a period of time.
if key[0] == EventTypes.MSC1772_SPACE_CHILD
or key[0] == EventTypes.SpaceChild
if key[0] == EventTypes.SpaceChild
]
)

Expand Down

0 comments on commit 4911f79

Please sign in to comment.