summary refs log tree commit diff
path: root/synapse/events/snapshot.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-07-24 11:46:09 +0100
committerRichard van der Hoff <richard@matrix.org>2018-07-24 11:46:09 +0100
commit30bfed5aa50317a7d05677c8de250d7d925938ac (patch)
tree256f995fef7eed858fff71920f706b866e7ac5e1 /synapse/events/snapshot.py
parentMerge remote-tracking branch 'origin/develop' into rav/remove_who_forgot_in_room (diff)
parentMerge pull request #3591 from matrix-org/rav/logcontext_fixes (diff)
downloadsynapse-30bfed5aa50317a7d05677c8de250d7d925938ac.tar.xz
Merge remote-tracking branch 'origin/develop' into rav/remove_who_forgot_in_room
Diffstat (limited to 'synapse/events/snapshot.py')
-rw-r--r--synapse/events/snapshot.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/events/snapshot.py b/synapse/events/snapshot.py
index a59064b416..189212b0fa 100644
--- a/synapse/events/snapshot.py
+++ b/synapse/events/snapshot.py
@@ -163,6 +163,9 @@ class EventContext(object):
         context._prev_state_id = input["prev_state_id"]
         context._event_type = input["event_type"]
         context._event_state_key = input["event_state_key"]
+
+        context._current_state_ids = None
+        context._prev_state_ids = None
         context._fetching_state_deferred = None
 
         context.state_group = input["state_group"]
@@ -214,6 +217,17 @@ class EventContext(object):
 
         defer.returnValue(self._prev_state_ids)
 
+    def get_cached_current_state_ids(self):
+        """Gets the current state IDs if we have them already cached.
+
+        Returns:
+            dict[(str, str), str]|None: Returns None if we haven't cached the
+            state or if state_group is None, which happens when the associated
+            event is an outlier.
+        """
+
+        return self._current_state_ids
+
     @defer.inlineCallbacks
     def _fill_out_state(self, store):
         """Called to populate the _current_state_ids and _prev_state_ids