From e8323b9e344a557452b17f4e0dea9d95feff747f Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 8 Dec 2014 10:16:18 +0000 Subject: More bug fixes --- synapse/handlers/_base.py | 6 +++++- synapse/handlers/room.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'synapse/handlers') diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py index 0bff644192..871564a3a2 100644 --- a/synapse/handlers/_base.py +++ b/synapse/handlers/_base.py @@ -70,7 +70,11 @@ class BaseHandler(object): builder.room_id, ) - depth = max([d for _, _, d in latest_ret]) + if latest_ret: + depth = max([d for _, _, d in latest_ret]) + else: + depth = 1 + prev_events = [(e, h) for e, h, _ in latest_ret] builder.prev_events = prev_events diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index f0ffd62b7f..ffcdbcfdf7 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -173,13 +173,14 @@ class RoomCreationHandler(BaseHandler): "sender": creator_id, } - def create(etype, content): + def create(etype, content, **kwargs): e = { "type": etype, "content": content, } e.update(event_keys) + e.update(kwargs) return e @@ -194,7 +195,6 @@ class RoomCreationHandler(BaseHandler): content={ "membership": Membership.JOIN, }, - **event_keys ) power_levels_event = create( -- cgit 1.4.1