From 17f4f14df7712426ffe0ddc3dc460820745de8a2 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 25 Aug 2016 13:28:31 +0100 Subject: Pull out event ids rather than full events for state --- synapse/events/snapshot.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'synapse/events/snapshot.py') diff --git a/synapse/events/snapshot.py b/synapse/events/snapshot.py index 8a475417a6..cf11b4aa2e 100644 --- a/synapse/events/snapshot.py +++ b/synapse/events/snapshot.py @@ -15,6 +15,14 @@ class EventContext(object): + def _set_current_state(self, current_state): + if current_state is not None: + self.current_state_ids = {k: e.event_id for k, e in current_state.items()} + else: + self.current_state_ids = None + self._current_state = current_state + + current_state = property(lambda self: self._current_state, _set_current_state) def __init__(self, current_state=None): self.current_state = current_state -- cgit 1.4.1