Stabilize the threads API. (#14175)

Stabilize the threads API (MSC3856) by supporting (only) the v1
path for the endpoint.

This also marks the API as safe for workers since it is a read-only
API.
This commit is contained in:
Patrick Cloke 2022-10-14 07:16:50 -04:00 committed by GitHub
parent 9ff4155f6c
commit c3e4edb4d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 29 deletions

View file

@ -82,11 +82,7 @@ class RelationPaginationServlet(RestServlet):
class ThreadsServlet(RestServlet):
PATTERNS = (
re.compile(
"^/_matrix/client/unstable/org.matrix.msc3856/rooms/(?P<room_id>[^/]*)/threads"
),
)
PATTERNS = (re.compile("^/_matrix/client/v1/rooms/(?P<room_id>[^/]*)/threads"),)
def __init__(self, hs: "HomeServer"):
super().__init__()
@ -126,5 +122,4 @@ class ThreadsServlet(RestServlet):
def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None:
RelationPaginationServlet(hs).register(http_server)
if hs.config.experimental.msc3856_enabled:
ThreadsServlet(hs).register(http_server)
ThreadsServlet(hs).register(http_server)