diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-12-14 14:46:55 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-12-14 14:46:55 +0000 |
commit | 15e988519749c92a6ff56ad8174cf17b9585bc64 (patch) | |
tree | 8184ed7827e1724ba58528acab89c7f4b4f9687f /synapse/rest | |
parent | Merge pull request #439 from matrix-org/daniel/typo (diff) | |
parent | Merge pull request #441 from matrix-org/markjh/fts_skip_invalid (diff) | |
download | synapse-15e988519749c92a6ff56ad8174cf17b9585bc64.tar.xz |
Merge branch 'release-v0.12.0' into develop
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/client/v2_alpha/sync.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py index f0a637a6da..3f8ce701dc 100644 --- a/synapse/rest/client/v2_alpha/sync.py +++ b/synapse/rest/client/v2_alpha/sync.py @@ -354,17 +354,20 @@ class SyncRestServlet(RestServlet): logger.debug("Replacing %s with %s in state dict", timeline_event.event_id, prev_event_id) - if prev_event_id is None: + prev_content = timeline_event.unsigned.get('prev_content') + prev_sender = timeline_event.unsigned.get('prev_sender') + if prev_event_id is None or not prev_content or not prev_sender: del result[event_key] else: result[event_key] = FrozenEvent({ "type": timeline_event.type, "state_key": timeline_event.state_key, - "content": timeline_event.unsigned['prev_content'], - "sender": timeline_event.unsigned['prev_sender'], + "content": prev_content, + "sender": prev_sender, "event_id": prev_event_id, "room_id": timeline_event.room_id, }) + logger.debug("New value: %r", result.get(event_key)) return result |