diff options
author | Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> | 2022-02-11 10:32:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 09:32:11 +0000 |
commit | d36943c4df841e789ef85c206c7fc7c4665ba4bd (patch) | |
tree | 92576656d850267dc28f3f12c60daabe34936400 /synapse/rest/client/capabilities.py | |
parent | Drop support for EOL Ubuntu 21.04 (#11961) (diff) | |
download | synapse-d36943c4df841e789ef85c206c7fc7c4665ba4bd.tar.xz |
Support the stable API endpoint for MSC3283: new settings in `/capabilities` endpoint (#11933)
Diffstat (limited to 'synapse/rest/client/capabilities.py')
-rw-r--r-- | synapse/rest/client/capabilities.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/synapse/rest/client/capabilities.py b/synapse/rest/client/capabilities.py index 5c0e3a5680..6682da077a 100644 --- a/synapse/rest/client/capabilities.py +++ b/synapse/rest/client/capabilities.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging +from http import HTTPStatus from typing import TYPE_CHECKING, Tuple from synapse.api.room_versions import KNOWN_ROOM_VERSIONS, MSC3244_CAPABILITIES @@ -54,6 +55,15 @@ class CapabilitiesRestServlet(RestServlet): }, }, "m.change_password": {"enabled": change_password}, + "m.set_displayname": { + "enabled": self.config.registration.enable_set_displayname + }, + "m.set_avatar_url": { + "enabled": self.config.registration.enable_set_avatar_url + }, + "m.3pid_changes": { + "enabled": self.config.registration.enable_3pid_changes + }, } } @@ -62,6 +72,9 @@ class CapabilitiesRestServlet(RestServlet): "org.matrix.msc3244.room_capabilities" ] = MSC3244_CAPABILITIES + # Must be removed in later versions. + # Is only included for migration. + # Also the parts in `synapse/config/experimental.py`. if self.config.experimental.msc3283_enabled: response["capabilities"]["org.matrix.msc3283.set_displayname"] = { "enabled": self.config.registration.enable_set_displayname @@ -76,7 +89,7 @@ class CapabilitiesRestServlet(RestServlet): if self.config.experimental.msc3440_enabled: response["capabilities"]["io.element.thread"] = {"enabled": True} - return 200, response + return HTTPStatus.OK, response def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None: |