diff options
author | Paul Evans <leonerd@leonerd.org.uk> | 2014-11-18 16:44:25 +0000 |
---|---|---|
committer | Paul Evans <leonerd@leonerd.org.uk> | 2014-11-18 16:44:25 +0000 |
commit | 11fd81e3984f4efc292b9f89c733e0790e1f3c2c (patch) | |
tree | 21aaab20cee6e630eb75c9b2e723afccc8af8813 /synapse/rest/room.py | |
parent | Revert accidental commit of bad file (diff) | |
parent | Ensure to parse a real pagination config object out of room initialSync reque... (diff) | |
download | synapse-11fd81e3984f4efc292b9f89c733e0790e1f3c2c.tar.xz |
Merge pull request #17 from matrix-org/room-initial-sync
Room initial sync
Diffstat (limited to 'synapse/rest/room.py')
-rw-r--r-- | synapse/rest/room.py | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/synapse/rest/room.py b/synapse/rest/room.py index 05da0be090..17322ee9bb 100644 --- a/synapse/rest/room.py +++ b/synapse/rest/room.py @@ -361,27 +361,14 @@ class RoomInitialSyncRestServlet(RestServlet): @defer.inlineCallbacks def on_GET(self, request, room_id): - yield self.auth.get_user_by_req(request) - # TODO: Get all the initial sync data for this room and return in the - # same format as initial sync, that is: - # { - # membership: join, - # messages: [ - # chunk: [ msg events ], - # start: s_tok, - # end: e_tok - # ], - # room_id: foo, - # state: [ - # { state event } , { state event } - # ] - # } - # Probably worth keeping the keys room_id and membership for parity - # with /initialSync even though they must be joined to sync this and - # know the room ID, so clients can reuse the same code (room_id and - # membership are MANDATORY for /initialSync, so the code will expect - # it to be there) - defer.returnValue((200, {})) + user = yield self.auth.get_user_by_req(request) + pagination_config = PaginationConfig.from_request(request) + content = yield self.handlers.message_handler.room_initial_sync( + room_id=room_id, + user_id=user.to_string(), + pagin_config=pagination_config, + ) + defer.returnValue((200, content)) class RoomTriggerBackfill(RestServlet): |