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

Commit dfa5364

Browse files
authored
Add support for /_matrix/client/v3 APIs (#11318)
This is one of the changes required to support Matrix 1.1 Signed-off-by: Aaron Raimist <[email protected]>
1 parent 7468723 commit dfa5364

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

changelog.d/11318.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add support for the `/_matrix/client/v3` APIs from Matrix v1.1.

synapse/app/homeserver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ def _configure_named_resource(
193193
{
194194
"/_matrix/client/api/v1": client_resource,
195195
"/_matrix/client/r0": client_resource,
196+
"/_matrix/client/v3": client_resource,
196197
"/_matrix/client/unstable": client_resource,
197198
"/_matrix/client/v2_alpha": client_resource,
198199
"/_matrix/client/versions": client_resource,

synapse/rest/client/_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
def client_patterns(
2929
path_regex: str,
30-
releases: Iterable[int] = (0,),
30+
releases: Iterable[str] = ("r0", "v3"),
3131
unstable: bool = True,
3232
v1: bool = False,
3333
) -> Iterable[Pattern]:
@@ -52,7 +52,7 @@ def client_patterns(
5252
v1_prefix = CLIENT_API_PREFIX + "/api/v1"
5353
patterns.append(re.compile("^" + v1_prefix + path_regex))
5454
for release in releases:
55-
new_prefix = CLIENT_API_PREFIX + "/r%d" % (release,)
55+
new_prefix = CLIENT_API_PREFIX + f"/{release}"
5656
patterns.append(re.compile("^" + new_prefix + path_regex))
5757

5858
return patterns

synapse/rest/client/keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class SigningKeyUploadServlet(RestServlet):
262262
}
263263
"""
264264

265-
PATTERNS = client_patterns("/keys/device_signing/upload$", releases=())
265+
PATTERNS = client_patterns("/keys/device_signing/upload$", releases=("v3",))
266266

267267
def __init__(self, hs: "HomeServer"):
268268
super().__init__()

0 commit comments

Comments
 (0)