summary refs log tree commit diff
path: root/synapse/storage/events.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2015-11-10 18:29:25 +0000
committerRichard van der Hoff <richard@matrix.org>2015-11-13 10:58:56 +0000
commite4d622aaaf0df503f942d016a5bf798dd52899d1 (patch)
treea80ccd094d9dacafdbe02dc4a6705b0f3d217c2b /synapse/storage/events.py
parentFix a few race conditions in the state calculation (diff)
downloadsynapse-e4d622aaaf0df503f942d016a5bf798dd52899d1.tar.xz
Implementation of state rollback in /sync
Implementation of SPEC-254: roll back the state dictionary to how it looked at
the start of the timeline.

Merged PR https://github.com/matrix-org/synapse/pull/373
Diffstat (limited to '')
-rw-r--r--synapse/storage/events.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 4a365ff639..5d35ca90b9 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -831,7 +831,8 @@ class EventsStore(SQLBaseStore):
                 allow_none=True,
             )
             if prev:
-                ev.unsigned["prev_content"] = prev.get_dict()["content"]
+                ev.unsigned["prev_content"] = prev.content
+                ev.unsigned["prev_sender"] = prev.sender
 
         self._get_event_cache.prefill(
             (ev.event_id, check_redacted, get_prev_content), ev
@@ -888,7 +889,8 @@ class EventsStore(SQLBaseStore):
                 get_prev_content=False,
             )
             if prev:
-                ev.unsigned["prev_content"] = prev.get_dict()["content"]
+                ev.unsigned["prev_content"] = prev.content
+                ev.unsigned["prev_sender"] = prev.sender
 
         self._get_event_cache.prefill(
             (ev.event_id, check_redacted, get_prev_content), ev