summary refs log tree commit diff
path: root/synapse/handlers/profile.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-03-15 11:55:51 +0000
committerErik Johnston <erik@matrix.org>2019-03-15 14:39:25 +0000
commit5827e976fe1f7ac5aa9123d2167fe80c2d9de1ca (patch)
tree1e24b6d82ecd8ba7f9d0bd80aa49e1ec508f1d5f /synapse/handlers/profile.py
parentMerge branch 'master' of github.com:matrix-org/synapse into erikj/dinsic-merg... (diff)
downloadsynapse-5827e976fe1f7ac5aa9123d2167fe80c2d9de1ca.tar.xz
Fixups
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r--synapse/handlers/profile.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py
index 0a952dab97..2313379c58 100644
--- a/synapse/handlers/profile.py
+++ b/synapse/handlers/profile.py
@@ -20,6 +20,8 @@ from signedjson.sign import sign_json
 
 from twisted.internet import defer, reactor
 
+from six.moves import range
+
 from synapse.api.errors import (
     AuthError,
     CodeMessageException,
@@ -100,7 +102,7 @@ class BaseProfileHandler(BaseHandler):
             if repl_host not in host_batches:
                 host_batches[repl_host] = -1
             try:
-                for i in xrange(host_batches[repl_host] + 1, latest_batch + 1):
+                for i in range(host_batches[repl_host] + 1, latest_batch + 1):
                     yield self._replicate_host_profile_batch(repl_host, i)
             except Exception:
                 logger.exception(
@@ -272,14 +274,16 @@ class BaseProfileHandler(BaseHandler):
     @defer.inlineCallbacks
     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 or hidden.
-        If 'hide' is true, then we interpret active=False as a request to try to hide the
-        user rather than deactivating it.  This means withholding the profile 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.
+        Sets the 'active' flag on a user profile. If set to false, the user
+        account is considered deactivated or hidden.
+
+        If 'hide' is true, then we interpret active=False as a request to try to
+        hide the user rather than deactivating it.  This means withholding the
+        profile 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.
         """
         if len(self.hs.config.replicate_user_profiles_to) > 0:
             cur_batchnum = yield self.store.get_latest_profile_replication_batch_number()