summary refs log tree commit diff
path: root/synapse/handlers/directory.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-04 15:50:01 +0000
committerErik Johnston <erik@matrix.org>2014-12-04 15:50:01 +0000
commitc31dba86ec40853f27c70ae13409ca3332052cc1 (patch)
treeab5a11519590c3c8e2211aedd2b441a7ccc759d5 /synapse/handlers/directory.py
parentBegin converting things to use the new Event structure (diff)
downloadsynapse-c31dba86ec40853f27c70ae13409ca3332052cc1.tar.xz
Convert rest and handlers to use new event structure
Diffstat (limited to 'synapse/handlers/directory.py')
-rw-r--r--synapse/handlers/directory.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index b95c4b8bf7..76fb897f20 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -148,16 +148,12 @@ class DirectoryHandler(BaseHandler):
     def send_room_alias_update_event(self, user_id, room_id):
         aliases = yield self.store.get_aliases_for_room(room_id)
 
-        event = self.event_factory.create_event(
-            etype=RoomAliasesEvent.TYPE,
-            state_key=self.hs.hostname,
-            room_id=room_id,
-            user_id=user_id,
-            content={"aliases": aliases},
-        )
-
-        snapshot = yield self.store.snapshot_room(event)
+        msg_handler = self.hs.get_handlers().message_handler
+        yield msg_handler.handle_event({
+            "type": RoomAliasesEvent.TYPE,
+            "state_key": self.hs.hostname,
+            "room_id": room_id,
+            "sender": user_id,
+            "content": {"aliases": aliases},
+        })
 
-        yield self._on_new_room_event(
-            event, snapshot, extra_users=[user_id], suppress_auth=True
-        )