summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-31 16:17:53 +0100
committerGitHub <noreply@github.com>2019-10-31 16:17:53 +0100
commitdfe0cd71b61c043592cc27b64725918aa5c64724 (patch)
treeec416471ef0ef54e0f959a9618a07e6ba9ccb64c /synapse/handlers/room.py
parentExpose some homeserver functionality to spam checkers (#6259) (diff)
parentApply suggestions from code review (diff)
downloadsynapse-dfe0cd71b61c043592cc27b64725918aa5c64724.tar.xz
Merge pull request #6294 from matrix-org/erikj/add_state_storage
Add StateGroupStorage interface
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 445a08f445..650bd28abb 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -822,6 +822,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):
@@ -848,7 +850,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(
@@ -890,7 +892,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())