summary refs log tree commit diff
path: root/synapse/storage/roommember.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-08-26 10:37:31 +0100
committerKegan Dougal <kegan@matrix.org>2014-08-26 10:37:31 +0100
commitf6daa9f1703d0f924dc2c519151b841def4a051b (patch)
treefeebb74986533487afe19e91f3e52437d3fd1fad /synapse/storage/roommember.py
parentAdd 'state_key' to valid_keys (diff)
parentURL renaming: Room state keys now use the format /rooms/$roomid/state/$event_... (diff)
downloadsynapse-f6daa9f1703d0f924dc2c519151b841def4a051b.tar.xz
Merge branch 'client_server_url_rename' into develop
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r--synapse/storage/roommember.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index aca5cff737..a9a09e1425 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -35,13 +35,14 @@ class RoomMemberStore(SQLBaseStore):
     def _store_room_member(self, event):
         """Store a room member in the database.
         """
-        domain = self.hs.parse_userid(event.target_user_id).domain
+        target_user_id = event.state_key
+        domain = self.hs.parse_userid(target_user_id).domain
 
         yield self._simple_insert(
             "room_memberships",
             {
                 "event_id": event.event_id,
-                "user_id": event.target_user_id,
+                "user_id": target_user_id,
                 "sender": event.user_id,
                 "room_id": event.room_id,
                 "membership": event.membership,