summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-16 19:21:18 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-16 19:21:18 +0000
commit6d29b5342449316944ffd26a5d61f5a7600298b7 (patch)
tree49d72fbfb565287ab59b45ad7b35fb85f417377b /synapse/handlers/room.py
parentExpose some homeserver functionality to spam checkers (#6259) (diff)
parentMerge pull request #6294 from matrix-org/erikj/add_state_storage (diff)
downloadsynapse-6d29b5342449316944ffd26a5d61f5a7600298b7.tar.xz
Merge pull request #6294 from matrix-org/erikj/add_state_storage
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 0dce0109de..1fec1a1f31 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -849,6 +849,8 @@ class RoomContextHandler(object):
     def __init__(self, hs):
         self.hs = hs
         self.store = hs.get_datastore()
+        self.storage = hs.get_storage()
+        self.state_store = self.storage.state
 
     @defer.inlineCallbacks
     def get_event_context(self, user, room_id, event_id, limit, event_filter):
@@ -875,7 +877,7 @@ class RoomContextHandler(object):
 
         def filter_evts(events):
             return filter_events_for_client(
-                self.store, user.to_string(), events, is_peeking=is_peeking
+                self.storage, user.to_string(), events, is_peeking=is_peeking
             )
 
         event = yield self.store.get_event(
@@ -917,7 +919,7 @@ class RoomContextHandler(object):
         # first? Shouldn't we be consistent with /sync?
         # https://github.com/matrix-org/matrix-doc/issues/687
 
-        state = yield self.store.get_state_for_events(
+        state = yield self.state_store.get_state_for_events(
             [last_event_id], state_filter=state_filter
         )
         results["state"] = list(state[last_event_id].values())