summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-05-31 13:53:48 +0100
committerMark Haines <mark.haines@matrix.org>2016-05-31 13:53:48 +0100
commitc626fc576a87f401c594cbb070d5b0000e45b4e1 (patch)
treee72ab5618420cd31c55493ed56f3e781c6eb1078 /synapse/notifier.py
parentMerge pull request #802 from matrix-org/dbkr/split_room_list_handler (diff)
downloadsynapse-c626fc576a87f401c594cbb070d5b0000e45b4e1.tar.xz
Move the AS handler out of the Handlers object.
Access it directly from the homeserver itself. It already wasn't
inheriting from BaseHandler storing it on the Handlers object was
already somewhat dubious.
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r--synapse/notifier.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index 33b79c0ec7..cbec4d30ae 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -140,8 +140,6 @@ class Notifier(object):
     UNUSED_STREAM_EXPIRY_MS = 10 * 60 * 1000
 
     def __init__(self, hs):
-        self.hs = hs
-
         self.user_to_user_stream = {}
         self.room_to_user_streams = {}
         self.appservice_to_user_streams = {}
@@ -151,6 +149,8 @@ class Notifier(object):
         self.pending_new_room_events = []
 
         self.clock = hs.get_clock()
+        self.appservice_handler = hs.get_application_service_handler()
+        self.state_handler = hs.get_state_handler()
 
         hs.get_distributor().observe(
             "user_joined_room", self._user_joined_room
@@ -232,9 +232,7 @@ class Notifier(object):
     def _on_new_room_event(self, event, room_stream_id, extra_users=[]):
         """Notify any user streams that are interested in this room event"""
         # poke any interested application service.
-        self.hs.get_handlers().appservice_handler.notify_interested_services(
-            event
-        )
+        self.appservice_handler.notify_interested_services(event)
 
         app_streams = set()
 
@@ -449,7 +447,7 @@ class Notifier(object):
 
     @defer.inlineCallbacks
     def _is_world_readable(self, room_id):
-        state = yield self.hs.get_state_handler().get_current_state(
+        state = yield self.state_handler.get_current_state(
             room_id,
             EventTypes.RoomHistoryVisibility
         )