diff options
author | Erik Johnston <erik@matrix.org> | 2014-11-06 15:10:55 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-11-06 15:10:55 +0000 |
commit | 4317c8e5835f0c15bf882f737d3e3c2a5b85f73f (patch) | |
tree | 4f1b822a5122529b69f54d7ed7f8b88d772171a5 /synapse/handlers/room.py | |
parent | Fix a couple more storage tests (diff) | |
download | synapse-4317c8e5835f0c15bf882f737d3e3c2a5b85f73f.tar.xz |
Implement new replace_state and changed prev_state
`prev_state` is now a list of previous state ids, similiar to prev_events. `replace_state` now points to what we think was replaced.
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r-- | synapse/handlers/room.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index f176ad39bf..55c893eb58 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -122,10 +122,7 @@ class RoomCreationHandler(BaseHandler): @defer.inlineCallbacks def handle_event(event): - snapshot = yield self.store.snapshot_room( - room_id=room_id, - user_id=user_id, - ) + snapshot = yield self.store.snapshot_room(event) logger.debug("Event: %s", event) @@ -364,10 +361,8 @@ class RoomMemberHandler(BaseHandler): """ target_user_id = event.state_key - snapshot = yield self.store.snapshot_room( - event.room_id, event.user_id, - RoomMemberEvent.TYPE, target_user_id - ) + snapshot = yield self.store.snapshot_room(event) + ## TODO(markjh): get prev state from snapshot. prev_state = yield self.store.get_room_member( target_user_id, event.room_id @@ -442,10 +437,7 @@ class RoomMemberHandler(BaseHandler): content=content, ) - snapshot = yield self.store.snapshot_room( - room_id, joinee.to_string(), RoomMemberEvent.TYPE, - joinee.to_string() - ) + snapshot = yield self.store.snapshot_room(new_event) yield self._do_join(new_event, snapshot, room_host=host, do_auth=True) |