summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-08-27 15:11:51 +0100
committerMark Haines <mark.haines@matrix.org>2014-08-27 15:11:51 +0100
commita0d1f5a014cf6000cc39231278408789e0019fe8 (patch)
treefbcf3765aea5fc0ed9a0bad99f41a5a195b02d51 /synapse/handlers
parentRemove call to get_federation from homeserver (diff)
downloadsynapse-a0d1f5a014cf6000cc39231278408789e0019fe8.tar.xz
Start updating state handling to use snapshots
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/room.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 9b02ce0dfd..47dcc6544d 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -133,7 +133,7 @@ class MessageHandler(BaseRoomHandler):
         if stamp_event:
             event.content["hsob_ts"] = int(self.clock.time_msec())
 
-        yield self.state_handler.handle_new_event(event)
+        yield self.state_handler.handle_new_event(event, snapshot)
 
         yield self._on_new_room_event(event, snapshot)
 
@@ -362,6 +362,13 @@ class RoomCreationHandler(BaseRoomHandler):
             content=config,
         )
 
+        snapshot = yield self.store.snapshot_room(
+            room_id=room_id,
+            user_id=user_id,
+            state_type=RoomConfigEvent.TYPE,
+            state_key="",
+        )
+
         if room_alias:
             yield self.store.create_room_alias_association(
                 room_id=room_id,
@@ -369,11 +376,11 @@ class RoomCreationHandler(BaseRoomHandler):
                 servers=[self.hs.hostname],
             )
 
-        yield self.state_handler.handle_new_event(config_event)
+        yield self.state_handler.handle_new_event(config_event, snapshot)
         # store_id = persist...
 
         federation_handler = self.hs.get_handlers().federation_handler
-        yield federation_handler.handle_new_event(config_event)
+        yield federation_handler.handle_new_event(config_event, snapshot)
         # self.notifier.on_new_room_event(event, store_id)
 
         content = {"membership": Membership.JOIN}