Remove unstable APIs for /hierarchy. (#12851)
Removes the unstable endpoint as well as a duplicated field which was modified during stabilization.
This commit is contained in:
parent
b5707ceaba
commit
1885ee0113
|
@ -0,0 +1 @@
|
||||||
|
Remove the unstable `/hierarchy` endpoint from [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946).
|
|
@ -193,7 +193,7 @@ information.
|
||||||
^/_matrix/federation/v1/user/devices/
|
^/_matrix/federation/v1/user/devices/
|
||||||
^/_matrix/federation/v1/get_groups_publicised$
|
^/_matrix/federation/v1/get_groups_publicised$
|
||||||
^/_matrix/key/v2/query
|
^/_matrix/key/v2/query
|
||||||
^/_matrix/federation/(v1|unstable/org.matrix.msc2946)/hierarchy/
|
^/_matrix/federation/v1/hierarchy/
|
||||||
|
|
||||||
# Inbound federation transaction request
|
# Inbound federation transaction request
|
||||||
^/_matrix/federation/v1/send/
|
^/_matrix/federation/v1/send/
|
||||||
|
@ -205,8 +205,8 @@ information.
|
||||||
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$
|
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/context/.*$
|
||||||
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$
|
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/members$
|
||||||
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$
|
^/_matrix/client/(api/v1|r0|v3|unstable)/rooms/.*/state$
|
||||||
^/_matrix/client/(v1|unstable/org.matrix.msc2946)/rooms/.*/hierarchy$
|
^/_matrix/client/v1/rooms/.*/hierarchy$
|
||||||
^/_matrix/client/(v1|unstable/org.matrix.msc2716)/rooms/.*/batch_send$
|
^/_matrix/client/unstable/org.matrix.msc2716/rooms/.*/batch_send$
|
||||||
^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$
|
^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$
|
||||||
^/_matrix/client/(r0|v3|unstable)/account/3pid$
|
^/_matrix/client/(r0|v3|unstable)/account/3pid$
|
||||||
^/_matrix/client/(r0|v3|unstable)/account/whoami$
|
^/_matrix/client/(r0|v3|unstable)/account/whoami$
|
||||||
|
|
|
@ -650,10 +650,6 @@ class FederationRoomHierarchyServlet(BaseFederationServlet):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class FederationRoomHierarchyUnstableServlet(FederationRoomHierarchyServlet):
|
|
||||||
PREFIX = FEDERATION_UNSTABLE_PREFIX + "/org.matrix.msc2946"
|
|
||||||
|
|
||||||
|
|
||||||
class RoomComplexityServlet(BaseFederationServlet):
|
class RoomComplexityServlet(BaseFederationServlet):
|
||||||
"""
|
"""
|
||||||
Indicates to other servers how complex (and therefore likely
|
Indicates to other servers how complex (and therefore likely
|
||||||
|
@ -752,7 +748,6 @@ FEDERATION_SERVLET_CLASSES: Tuple[Type[BaseFederationServlet], ...] = (
|
||||||
FederationVersionServlet,
|
FederationVersionServlet,
|
||||||
RoomComplexityServlet,
|
RoomComplexityServlet,
|
||||||
FederationRoomHierarchyServlet,
|
FederationRoomHierarchyServlet,
|
||||||
FederationRoomHierarchyUnstableServlet,
|
|
||||||
FederationV1SendKnockServlet,
|
FederationV1SendKnockServlet,
|
||||||
FederationMakeKnockServlet,
|
FederationMakeKnockServlet,
|
||||||
FederationAccountStatusServlet,
|
FederationAccountStatusServlet,
|
||||||
|
|
|
@ -662,7 +662,7 @@ class RoomSummaryHandler:
|
||||||
# The API doesn't return the room version so assume that a
|
# The API doesn't return the room version so assume that a
|
||||||
# join rule of knock is valid.
|
# join rule of knock is valid.
|
||||||
if (
|
if (
|
||||||
room.get("join_rules")
|
room.get("join_rule")
|
||||||
in (JoinRules.PUBLIC, JoinRules.KNOCK, JoinRules.KNOCK_RESTRICTED)
|
in (JoinRules.PUBLIC, JoinRules.KNOCK, JoinRules.KNOCK_RESTRICTED)
|
||||||
or room.get("world_readable") is True
|
or room.get("world_readable") is True
|
||||||
):
|
):
|
||||||
|
@ -714,9 +714,6 @@ class RoomSummaryHandler:
|
||||||
"canonical_alias": stats["canonical_alias"],
|
"canonical_alias": stats["canonical_alias"],
|
||||||
"num_joined_members": stats["joined_members"],
|
"num_joined_members": stats["joined_members"],
|
||||||
"avatar_url": stats["avatar"],
|
"avatar_url": stats["avatar"],
|
||||||
# plural join_rules is a documentation error but kept for historical
|
|
||||||
# purposes. Should match /publicRooms.
|
|
||||||
"join_rules": stats["join_rules"],
|
|
||||||
"join_rule": stats["join_rules"],
|
"join_rule": stats["join_rules"],
|
||||||
"world_readable": (
|
"world_readable": (
|
||||||
stats["history_visibility"] == HistoryVisibility.WORLD_READABLE
|
stats["history_visibility"] == HistoryVisibility.WORLD_READABLE
|
||||||
|
|
|
@ -1193,12 +1193,7 @@ class TimestampLookupRestServlet(RestServlet):
|
||||||
|
|
||||||
|
|
||||||
class RoomHierarchyRestServlet(RestServlet):
|
class RoomHierarchyRestServlet(RestServlet):
|
||||||
PATTERNS = (
|
PATTERNS = (re.compile("^/_matrix/client/v1/rooms/(?P<room_id>[^/]*)/hierarchy$"),)
|
||||||
re.compile(
|
|
||||||
"^/_matrix/client/(v1|unstable/org.matrix.msc2946)"
|
|
||||||
"/rooms/(?P<room_id>[^/]*)/hierarchy$"
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
def __init__(self, hs: "HomeServer"):
|
def __init__(self, hs: "HomeServer"):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
|
@ -179,7 +179,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
result_children_ids.append(
|
result_children_ids.append(
|
||||||
[
|
[
|
||||||
(cs["room_id"], cs["state_key"])
|
(cs["room_id"], cs["state_key"])
|
||||||
for cs in result_room.get("children_state")
|
for cs in result_room["children_state"]
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -772,7 +772,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": public_room,
|
"room_id": public_room,
|
||||||
"world_readable": False,
|
"world_readable": False,
|
||||||
"join_rules": JoinRules.PUBLIC,
|
"join_rule": JoinRules.PUBLIC,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
@ -780,7 +780,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": knock_room,
|
"room_id": knock_room,
|
||||||
"world_readable": False,
|
"world_readable": False,
|
||||||
"join_rules": JoinRules.KNOCK,
|
"join_rule": JoinRules.KNOCK,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
@ -788,7 +788,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": not_invited_room,
|
"room_id": not_invited_room,
|
||||||
"world_readable": False,
|
"world_readable": False,
|
||||||
"join_rules": JoinRules.INVITE,
|
"join_rule": JoinRules.INVITE,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
@ -796,7 +796,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": invited_room,
|
"room_id": invited_room,
|
||||||
"world_readable": False,
|
"world_readable": False,
|
||||||
"join_rules": JoinRules.INVITE,
|
"join_rule": JoinRules.INVITE,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
@ -804,7 +804,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": restricted_room,
|
"room_id": restricted_room,
|
||||||
"world_readable": False,
|
"world_readable": False,
|
||||||
"join_rules": JoinRules.RESTRICTED,
|
"join_rule": JoinRules.RESTRICTED,
|
||||||
"allowed_room_ids": [],
|
"allowed_room_ids": [],
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -813,7 +813,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": restricted_accessible_room,
|
"room_id": restricted_accessible_room,
|
||||||
"world_readable": False,
|
"world_readable": False,
|
||||||
"join_rules": JoinRules.RESTRICTED,
|
"join_rule": JoinRules.RESTRICTED,
|
||||||
"allowed_room_ids": [self.room],
|
"allowed_room_ids": [self.room],
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
@ -822,7 +822,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": world_readable_room,
|
"room_id": world_readable_room,
|
||||||
"world_readable": True,
|
"world_readable": True,
|
||||||
"join_rules": JoinRules.INVITE,
|
"join_rule": JoinRules.INVITE,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
|
@ -830,7 +830,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": joined_room,
|
"room_id": joined_room,
|
||||||
"world_readable": False,
|
"world_readable": False,
|
||||||
"join_rules": JoinRules.INVITE,
|
"join_rule": JoinRules.INVITE,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -911,7 +911,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
|
||||||
{
|
{
|
||||||
"room_id": fed_room,
|
"room_id": fed_room,
|
||||||
"world_readable": False,
|
"world_readable": False,
|
||||||
"join_rules": JoinRules.INVITE,
|
"join_rule": JoinRules.INVITE,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue