summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-05-16 18:56:37 +0100
committerMark Haines <mark.haines@matrix.org>2016-05-16 18:56:37 +0100
commit3b86ecfa7965f4d29e0f5ce8fb663e5f018adf89 (patch)
tree98f7e429892fa3e18bf88f920279c9c712d15b25 /synapse/handlers
parentMerge pull request #760 from matrix-org/matthew/preview_url_ip_whitelist (diff)
downloadsynapse-3b86ecfa7965f4d29e0f5ce8fb663e5f018adf89.tar.xz
Move the presence handler out of the Handlers object
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/__init__.py2
-rw-r--r--synapse/handlers/events.py2
-rw-r--r--synapse/handlers/message.py4
-rw-r--r--synapse/handlers/presence.py2
-rw-r--r--synapse/handlers/sync.py2
5 files changed, 5 insertions, 7 deletions
diff --git a/synapse/handlers/__init__.py b/synapse/handlers/__init__.py
index f4dbf47c1d..60e31b68ff 100644
--- a/synapse/handlers/__init__.py
+++ b/synapse/handlers/__init__.py
@@ -24,7 +24,6 @@ from .message import MessageHandler
 from .events import EventStreamHandler, EventHandler
 from .federation import FederationHandler
 from .profile import ProfileHandler
-from .presence import PresenceHandler
 from .directory import DirectoryHandler
 from .typing import TypingNotificationHandler
 from .admin import AdminHandler
@@ -53,7 +52,6 @@ class Handlers(object):
         self.event_handler = EventHandler(hs)
         self.federation_handler = FederationHandler(hs)
         self.profile_handler = ProfileHandler(hs)
-        self.presence_handler = PresenceHandler(hs)
         self.room_list_handler = RoomListHandler(hs)
         self.directory_handler = DirectoryHandler(hs)
         self.typing_notification_handler = TypingNotificationHandler(hs)
diff --git a/synapse/handlers/events.py b/synapse/handlers/events.py
index f25a252523..3a3a1257d3 100644
--- a/synapse/handlers/events.py
+++ b/synapse/handlers/events.py
@@ -58,7 +58,7 @@ class EventStreamHandler(BaseHandler):
         If `only_keys` is not None, events from keys will be sent down.
         """
         auth_user = UserID.from_string(auth_user_id)
-        presence_handler = self.hs.get_handlers().presence_handler
+        presence_handler = self.hs.get_presence_handler()
 
         context = yield presence_handler.user_syncing(
             auth_user_id, affect_presence=affect_presence,
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 13154edb78..c4e38d0faa 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -236,7 +236,7 @@ class MessageHandler(BaseHandler):
         )
 
         if event.type == EventTypes.Message:
-            presence = self.hs.get_handlers().presence_handler
+            presence = self.hs.get_presence_handler()
             yield presence.bump_presence_active_time(user)
 
     def deduplicate_state_event(self, event, context):
@@ -674,7 +674,7 @@ class MessageHandler(BaseHandler):
             and m.content["membership"] == Membership.JOIN
         ]
 
-        presence_handler = self.hs.get_handlers().presence_handler
+        presence_handler = self.hs.get_presence_handler()
 
         @defer.inlineCallbacks
         def get_presence():
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index a8529cce42..8aaaec7030 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -860,7 +860,7 @@ class PresenceEventSource(object):
                 from_key = int(from_key)
             room_ids = room_ids or []
 
-            presence = self.hs.get_handlers().presence_handler
+            presence = self.hs.get_presence_handler()
             stream_change_cache = self.store.presence_stream_cache
 
             if not room_ids:
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 921215469f..b30102f472 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -639,7 +639,7 @@ class SyncHandler(BaseHandler):
 
         # For each newly joined room, we want to send down presence of
         # existing users.
-        presence_handler = self.hs.get_handlers().presence_handler
+        presence_handler = self.hs.get_presence_handler()
         extra_presence_users = set()
         for room_id in newly_joined_rooms:
             users = yield self.store.get_users_in_room(event.room_id)