summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-25 13:28:31 +0100
committerErik Johnston <erik@matrix.org>2016-08-25 13:42:44 +0100
commit17f4f14df7712426ffe0ddc3dc460820745de8a2 (patch)
tree5ff57a2b03605a28f3f391d57169e6349622de9d /synapse/events
parentMerge branch 'release-v0.17.1' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-17f4f14df7712426ffe0ddc3dc460820745de8a2.tar.xz
Pull out event ids rather than full events for state
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/snapshot.py8
1 files changed, 8 insertions, 0 deletions
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