diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-10-08 15:17:43 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-10-08 15:17:43 +0100 |
commit | dfef2b41aa3202b130661c3c423b2cf7d0dbba97 (patch) | |
tree | 5820cdca8c47710b2bb6f8552e11280873bc3cad /synapse/rest | |
parent | Update the sync response to match the latest spec (diff) | |
download | synapse-dfef2b41aa3202b130661c3c423b2cf7d0dbba97.tar.xz |
Update the v2 room sync format to match the current v2 spec
Diffstat (limited to '')
-rw-r--r-- | synapse/rest/client/v2_alpha/sync.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py index 84011918af..97bf95acfb 100644 --- a/synapse/rest/client/v2_alpha/sync.py +++ b/synapse/rest/client/v2_alpha/sync.py @@ -158,7 +158,7 @@ class SyncRestServlet(RestServlet): def encode_room(room, filter, time_now, token_id): event_map = {} state_events = filter.filter_room_state(room.state) - recent_events = filter.filter_room_events(room.events) + recent_events = filter.filter_room_events(room.timeline.events) state_event_ids = [] recent_event_ids = [] for event in state_events: @@ -178,13 +178,13 @@ class SyncRestServlet(RestServlet): recent_event_ids.append(event.event_id) result = { "event_map": event_map, - "events": { - "batch": recent_event_ids, - "prev_batch": room.prev_batch.to_string(), + "timeline": { + "events": recent_event_ids, + "prev_batch": room.timeline.prev_batch.to_string(), + "limited": room.timeline.limited, }, - "state": state_event_ids, - "limited": room.limited, - "ephemeral": room.ephemeral, + "state": {"events": state_event_ids}, + "ephemeral": {"events": room.ephemeral}, } return result |