summary refs log tree commit diff
path: root/synapse/handlers/profile.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-11-04 23:46:11 +0000
committerMatthew Hodgson <matthew@matrix.org>2018-11-04 23:46:11 +0000
commitae5bb32ad0d50b90c5d3833e132dc4ba58a4eb86 (patch)
tree5cacd32ff8e8136348a2a143d0e5376699d5184f /synapse/handlers/profile.py
parentfix tests (diff)
downloadsynapse-ae5bb32ad0d50b90c5d3833e132dc4ba58a4eb86.tar.xz
add im.vector.hide_profile to user account_data
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r--synapse/handlers/profile.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py
index 65e29518f0..58e9181f01 100644
--- a/synapse/handlers/profile.py
+++ b/synapse/handlers/profile.py
@@ -270,10 +270,13 @@ class BaseProfileHandler(BaseHandler):
         run_in_background(self._replicate_profiles)
 
     @defer.inlineCallbacks
-    def set_active(self, target_user, active):
+    def set_active(self, target_user, active, hide):
         """
         Sets the 'active' flag on a user profile. If set to false, the user account is
-        considered deactivated.
+        considered deactivated or hidden.
+        If 'hide' is true, then we just try hide the user rather than deactivate it.
+        This means withholding it from replication (and mark it as inactive) rather than
+        clearing the profile from the HS DB.
         Note that unlike set_displayname and set_avatar_url, this does *not* perform
         authorization checks! This is because the only place it's used currently is
         in account deactivation where we've already done these checks anyway.
@@ -284,7 +287,7 @@ class BaseProfileHandler(BaseHandler):
         else:
             new_batchnum = None
         yield self.store.set_profile_active(
-            target_user.localpart, active, new_batchnum
+            target_user.localpart, active, hide, new_batchnum
         )
 
         # start a profile replication push