Make handlers.sync return a state dictionary, instead of an event list.

Basically this moves the process of flattening the existing dictionary into a
list up to rest.client.*, instead of doing it in handlers.sync. This simplifies
a bit of the code in handlers.sync, but it is also going to be somewhat
beneficial in the next stage of my hacking on SPEC-254.

Merged from PR #371
This commit is contained in:
Richard van der Hoff 2015-11-12 16:34:42 +00:00
parent 5dea4d37d1
commit 5ab4b0afe8
2 changed files with 40 additions and 32 deletions

View file

@ -256,7 +256,7 @@ class SyncRestServlet(RestServlet):
:rtype: dict[str, object]
"""
event_map = {}
state_events = filter.filter_room_state(room.state)
state_events = filter.filter_room_state(room.state.values())
state_event_ids = []
for event in state_events:
# TODO(mjark): Respect formatting requirements in the filter.