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

Commit ab23b4c

Browse files
committed
Add flag in /versions for whether clients should send id_server params
1 parent b13cac8 commit ab23b4c

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

synapse/rest/client/versions.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
class VersionsRestServlet(RestServlet):
2525
PATTERNS = [re.compile("^/_matrix/client/versions$")]
2626

27+
def __init__(self, hs):
28+
super(VersionsRestServlet, self).__init__()
29+
self.config = hs.config
30+
2731
def on_GET(self, request):
2832
return (
2933
200,
@@ -44,10 +48,22 @@ def on_GET(self, request):
4448
"r0.5.0",
4549
],
4650
# as per MSC1497:
47-
"unstable_features": {"m.lazy_load_members": True},
51+
"unstable_features": {
52+
"m.lazy_load_members": True,
53+
# Advertise to clients whether they need not include an `id_server`
54+
# parameter during registration or password reset, as Synapse now decides
55+
# itself which identity server to use (or none at all).
56+
#
57+
# This is also used by a client when they wish to bind a 3PID to their
58+
# account, but not bind it to an identity server, the endpoint for which
59+
# also requires `id_server`. If the homeserver is handling 3PID
60+
# verification itself, there is no need to ask the user for `id_server` to
61+
# be supplied.
62+
"m.require_identity_server": self.config.account_threepid_delegate is None
63+
},
4864
},
4965
)
5066

5167

52-
def register_servlets(http_server):
53-
VersionsRestServlet().register(http_server)
68+
def register_servlets(hs, http_server):
69+
VersionsRestServlet(hs).register(http_server)

0 commit comments

Comments
 (0)