summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-09-03 15:13:17 +0100
committerErik Johnston <erik@matrix.org>2018-10-16 16:16:13 +0100
commite238013c44714174f1bf9a2b9b1f576728f40784 (patch)
treee704d7baf57930de8c2cd5d9a48c3e06093a0ce6 /synapse/storage/events.py
parentVarious cleanups in the federation client code (#4031) (diff)
downloadsynapse-e238013c44714174f1bf9a2b9b1f576728f40784.tar.xz
Add v2 state res algorithm.
We hook this up to the vdh test room version.
Diffstat (limited to 'synapse/storage/events.py')
-rw-r--r--synapse/storage/events.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 03cedf3a75..fc88edcb39 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -34,6 +34,7 @@ from synapse.api.errors import SynapseError
 from synapse.events import EventBase  # noqa: F401
 from synapse.events.snapshot import EventContext  # noqa: F401
 from synapse.metrics.background_process_metrics import run_as_background_process
+from synapse.state import StateResolutionStore
 from synapse.storage.background_updates import BackgroundUpdateStore
 from synapse.storage.event_federation import EventFederationStore
 from synapse.storage.events_worker import EventsWorkerStore
@@ -731,11 +732,6 @@ class EventsStore(EventFederationStore, EventsWorkerStore, BackgroundUpdateStore
 
         # Ok, we need to defer to the state handler to resolve our state sets.
 
-        def get_events(ev_ids):
-            return self.get_events(
-                ev_ids, get_prev_content=False, check_redacted=False,
-            )
-
         state_groups = {
             sg: state_groups_map[sg] for sg in new_state_groups
         }
@@ -745,7 +741,8 @@ class EventsStore(EventFederationStore, EventsWorkerStore, BackgroundUpdateStore
 
         logger.debug("calling resolve_state_groups from preserve_events")
         res = yield self._state_resolution_handler.resolve_state_groups(
-            room_id, room_version, state_groups, events_map, get_events
+            room_id, room_version, state_groups, events_map,
+            state_res_store=StateResolutionStore(self)
         )
 
         defer.returnValue((res.state, None))