Convert rest and handlers to use new event structure

This commit is contained in:
Erik Johnston 2014-12-04 15:50:01 +00:00
parent 5d7c9ab789
commit c31dba86ec
14 changed files with 188 additions and 199 deletions

View file

@ -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},
)
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},
})
snapshot = yield self.store.snapshot_room(event)
yield self._on_new_room_event(
event, snapshot, extra_users=[user_id], suppress_auth=True
)