Use recommended endpoint for MSC3266 requests (#17078)

Keep the existing endpoint for backwards compatibility

Signed-off-by: Andrew Ferrazzutti <andrewf@element.io>
This commit is contained in:
Andrew Ferrazzutti 2024-04-26 17:46:42 +09:00 committed by GitHub
parent 0ef2315a99
commit 516fd891ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

1
changelog.d/17078.bugfix Normal file
View file

@ -0,0 +1 @@
For MSC3266 room summaries, support queries at the recommended endpoint of `/_matrix/client/unstable/im.nheko.summary/summary/{roomIdOrAlias}`. The existing endpoint of `/_matrix/client/unstable/im.nheko.summary/rooms/{roomIdOrAlias}/summary` is deprecated.

View file

@ -232,7 +232,7 @@ information.
^/_matrix/client/v1/rooms/.*/hierarchy$ ^/_matrix/client/v1/rooms/.*/hierarchy$
^/_matrix/client/(v1|unstable)/rooms/.*/relations/ ^/_matrix/client/(v1|unstable)/rooms/.*/relations/
^/_matrix/client/v1/rooms/.*/threads$ ^/_matrix/client/v1/rooms/.*/threads$
^/_matrix/client/unstable/im.nheko.summary/rooms/.*/summary$ ^/_matrix/client/unstable/im.nheko.summary/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$
^/_matrix/client/(r0|v3|unstable)/devices$ ^/_matrix/client/(r0|v3|unstable)/devices$

View file

@ -1442,10 +1442,16 @@ class RoomHierarchyRestServlet(RestServlet):
class RoomSummaryRestServlet(ResolveRoomIdMixin, RestServlet): class RoomSummaryRestServlet(ResolveRoomIdMixin, RestServlet):
PATTERNS = ( PATTERNS = (
# deprecated endpoint, to be removed
re.compile( re.compile(
"^/_matrix/client/unstable/im.nheko.summary" "^/_matrix/client/unstable/im.nheko.summary"
"/rooms/(?P<room_identifier>[^/]*)/summary$" "/rooms/(?P<room_identifier>[^/]*)/summary$"
), ),
# recommended endpoint
re.compile(
"^/_matrix/client/unstable/im.nheko.summary"
"/summary/(?P<room_identifier>[^/]*)$"
),
) )
CATEGORY = "Client API requests" CATEGORY = "Client API requests"