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

Commit

Permalink
Add flag in /versions for whether clients should send id_server params
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Aug 16, 2019
1 parent b13cac8 commit ab23b4c
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions synapse/rest/client/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
class VersionsRestServlet(RestServlet):
PATTERNS = [re.compile("^/_matrix/client/versions$")]

def __init__(self, hs):
super(VersionsRestServlet, self).__init__()
self.config = hs.config

def on_GET(self, request):
return (
200,
Expand All @@ -44,10 +48,22 @@ def on_GET(self, request):
"r0.5.0",
],
# as per MSC1497:
"unstable_features": {"m.lazy_load_members": True},
"unstable_features": {
"m.lazy_load_members": True,
# Advertise to clients whether they need not include an `id_server`
# parameter during registration or password reset, as Synapse now decides
# itself which identity server to use (or none at all).
#
# This is also used by a client when they wish to bind a 3PID to their
# account, but not bind it to an identity server, the endpoint for which
# also requires `id_server`. If the homeserver is handling 3PID
# verification itself, there is no need to ask the user for `id_server` to
# be supplied.
"m.require_identity_server": self.config.account_threepid_delegate is None
},
},
)


def register_servlets(http_server):
VersionsRestServlet().register(http_server)
def register_servlets(hs, http_server):
VersionsRestServlet(hs).register(http_server)

0 comments on commit ab23b4c

Please sign in to comment.