summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-18 10:59:57 +0100
committerErik Johnston <erik@matrix.org>2014-08-18 10:59:57 +0100
commit1a1e0384efb213acd74aeb8d669b1d43f18de667 (patch)
tree64a490f5f5b79aa69b47f986da280d25a4cbec80 /synapse/api
parentDon't bother generating png's (diff)
downloadsynapse-1a1e0384efb213acd74aeb8d669b1d43f18de667.tar.xz
Ensure we have a 'membership' key in RoomMemberEvents
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/events/room.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/api/events/room.py b/synapse/api/events/room.py
index dbf537fb88..42459f3f21 100644
--- a/synapse/api/events/room.py
+++ b/synapse/api/events/room.py
@@ -66,6 +66,8 @@ class RoomMemberEvent(SynapseEvent):
     def __init__(self, **kwargs):
         if "target_user_id" in kwargs:
             kwargs["state_key"] = kwargs["target_user_id"]
+        if "membership" not in kwargs:
+            kwargs["membership"] = kwargs.get("content", {}).get("membership")
         super(RoomMemberEvent, self).__init__(**kwargs)
 
     def get_content_template(self):