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
This commit is contained in:
Richard van der Hoff 2015-11-10 18:29:25 +00:00
parent fddedd51d9
commit e4d622aaaf
2 changed files with 69 additions and 4 deletions

View file

@ -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