summary refs log tree commit diff
path: root/synapse/rest/client/capabilities.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--synapse/rest/client/capabilities.py26
1 files changed, 19 insertions, 7 deletions
diff --git a/synapse/rest/client/capabilities.py b/synapse/rest/client/capabilities.py

index 63b8a9364a..caac5826a4 100644 --- a/synapse/rest/client/capabilities.py +++ b/synapse/rest/client/capabilities.py
@@ -21,7 +21,7 @@ import logging from http import HTTPStatus from typing import TYPE_CHECKING, Tuple -from synapse.api.room_versions import KNOWN_ROOM_VERSIONS, MSC3244_CAPABILITIES +from synapse.api.room_versions import KNOWN_ROOM_VERSIONS from synapse.http.server import HttpServer from synapse.http.servlet import RestServlet from synapse.http.site import SynapseRequest @@ -69,7 +69,7 @@ class CapabilitiesRestServlet(RestServlet): "enabled": self.config.registration.enable_set_avatar_url }, "m.3pid_changes": { - "enabled": self.config.registration.enable_3pid_changes + "enabled": False }, "m.get_login_token": { "enabled": self.config.auth.login_via_existing_enabled, @@ -77,11 +77,6 @@ class CapabilitiesRestServlet(RestServlet): } } - if self.config.experimental.msc3244_enabled: - response["capabilities"]["m.room_versions"][ - "org.matrix.msc3244.room_capabilities" - ] = MSC3244_CAPABILITIES - if self.config.experimental.msc3720_enabled: response["capabilities"]["org.matrix.msc3720.account_status"] = { "enabled": True, @@ -92,6 +87,23 @@ class CapabilitiesRestServlet(RestServlet): "enabled": self.config.experimental.msc3664_enabled, } + if self.config.experimental.msc4133_enabled: + response["capabilities"]["uk.tcpip.msc4133.profile_fields"] = { + "enabled": True, + } + + # Ensure this is consistent with the legacy m.set_displayname and + # m.set_avatar_url. + disallowed = [] + if not self.config.registration.enable_set_displayname: + disallowed.append("displayname") + if not self.config.registration.enable_set_avatar_url: + disallowed.append("avatar_url") + if disallowed: + response["capabilities"]["uk.tcpip.msc4133.profile_fields"][ + "disallowed" + ] = disallowed + return HTTPStatus.OK, response