summary refs log tree commit diff
path: root/synapse/handlers/profile.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-08-25 14:45:20 +0100
committerErik Johnston <erik@matrix.org>2017-08-25 14:45:20 +0100
commit258409ef6156782d0c15cd5d1c1620b5734f379c (patch)
treedff5504b581e2ad7e447ed3e91d688d371b21506 /synapse/handlers/profile.py
parentSplit out profile handler to fix tests (diff)
downloadsynapse-258409ef6156782d0c15cd5d1c1620b5734f379c.tar.xz
Fix typos and reinherit
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r--synapse/handlers/profile.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py
index 5e34501c7a..c3cee38a43 100644
--- a/synapse/handlers/profile.py
+++ b/synapse/handlers/profile.py
@@ -25,18 +25,12 @@ from ._base import BaseHandler
 logger = logging.getLogger(__name__)
 
 
-class ProfileHandler(object):
+class ProfileHandler(BaseHandler):
     PROFILE_UPDATE_MS = 60 * 1000
     PROFILE_UPDATE_EVERY_MS = 24 * 60 * 60 * 1000
 
     def __init__(self, hs):
-        self.hs = hs
-        self.store = hs.get_datastore()
-        self.clock = hs.get_clock()
-        self.ratelimiter = hs.get_ratelimiter()
-
-        # AWFUL hack to get at BaseHandler.ratelimit
-        self.base_handler = BaseHandler(hs)
+        super(ProfileHandler, self).__init__(hs)
 
         self.federation = hs.get_replication_layer()
         self.federation.register_query_handler(
@@ -197,7 +191,7 @@ class ProfileHandler(object):
         if not self.hs.is_mine(user):
             return
 
-        yield self.base_handler.ratelimit(requester)
+        yield self.ratelimit(requester)
 
         room_ids = yield self.store.get_rooms_for_user(
             user.to_string(),
@@ -225,7 +219,7 @@ class ProfileHandler(object):
                 )
 
     def _update_remote_profile_cache(self):
-        """Called periodically to check profiles of remote users we havent'
+        """Called periodically to check profiles of remote users we haven't
         checked in a while.
         """
         entries = yield self.store.get_remote_profile_cache_entries_that_expire(
@@ -233,10 +227,10 @@ class ProfileHandler(object):
         )
 
         for user_id, displayname, avatar_url in entries:
-            is_subcscribed = yield self.store.is_subscribed_remote_profile_for_user(
+            is_subscribed = yield self.store.is_subscribed_remote_profile_for_user(
                 user_id,
             )
-            if not is_subcscribed:
+            if not is_subscribed:
                 yield self.store.maybe_delete_remote_profile_cache(user_id)
                 continue