summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorMichael Kaye <1917473+michaelkaye@users.noreply.github.com>2018-12-19 15:42:19 +0000
committerGitHub <noreply@github.com>2018-12-19 15:42:19 +0000
commit9cc95fd0a5cc029ff9da7ed89c5645aa36834485 (patch)
treeb52a3d676e86bcdf3de81826d31f756d7521b946 /synapse/rest/client
parentfix tests (diff)
parenthide_profile: false should mean not to hide the profile :/ (diff)
downloadsynapse-9cc95fd0a5cc029ff9da7ed89c5645aa36834485.tar.xz
Merge pull request #4148 from matrix-org/matthew/red_list dinsic_2018-12-19
add im.vector.hide_profile to user account_data
Diffstat (limited to 'synapse/rest/client')
-rw-r--r--synapse/rest/client/v2_alpha/account_data.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/account_data.py b/synapse/rest/client/v2_alpha/account_data.py

index 371e9aa354..21c734e525 100644 --- a/synapse/rest/client/v2_alpha/account_data.py +++ b/synapse/rest/client/v2_alpha/account_data.py
@@ -19,6 +19,7 @@ from twisted.internet import defer from synapse.api.errors import AuthError, SynapseError from synapse.http.servlet import RestServlet, parse_json_object_from_request +from synapse.types import UserID from ._base import client_v2_patterns @@ -38,6 +39,7 @@ class AccountDataServlet(RestServlet): self.auth = hs.get_auth() self.store = hs.get_datastore() self.notifier = hs.get_notifier() + self._profile_handler = hs.get_profile_handler() @defer.inlineCallbacks def on_PUT(self, request, user_id, account_data_type): @@ -47,6 +49,11 @@ class AccountDataServlet(RestServlet): body = parse_json_object_from_request(request) + if account_data_type == "im.vector.hide_profile": + user = UserID.from_string(user_id) + hide_profile = body.get('hide_profile') + yield self._profile_handler.set_active(user, not hide_profile, True) + max_id = yield self.store.add_account_data_for_user( user_id, account_data_type, body )