Ensure we have a 'membership' key in RoomMemberEvents

pull/4/merge
Erik Johnston 10 years ago
parent bc2512fa95
commit 1a1e0384ef
  1. 2
      synapse/api/events/room.py

@ -66,6 +66,8 @@ class RoomMemberEvent(SynapseEvent):
def __init__(self, **kwargs): def __init__(self, **kwargs):
if "target_user_id" in kwargs: if "target_user_id" in kwargs:
kwargs["state_key"] = kwargs["target_user_id"] kwargs["state_key"] = kwargs["target_user_id"]
if "membership" not in kwargs:
kwargs["membership"] = kwargs.get("content", {}).get("membership")
super(RoomMemberEvent, self).__init__(**kwargs) super(RoomMemberEvent, self).__init__(**kwargs)
def get_content_template(self): def get_content_template(self):

Loading…
Cancel
Save