summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-01-25 11:24:28 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2019-01-25 11:24:28 +0000
commitc4cdafa81fdf167961257f16118735b304535f62 (patch)
tree4b295749437bebf1205b1b5fe7206b0bccfe4ac0
parentRemove unnecessary null check (diff)
downloadsynapse-c4cdafa81fdf167961257f16118735b304535f62.tar.xz
Destructure account data tuple before use
-rw-r--r--synapse/handlers/room_member.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index 3d4500fb18..bde4798d0c 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -262,13 +262,13 @@ class RoomMemberHandler(object):
             old_room_id = create_event["content"]["predecessor"]["room_id"]
 
             # Retrieve user account data for predecessor room
-            user_account_data = yield self.store.get_account_data_for_user(
+            user_account_data, _ = yield self.store.get_account_data_for_user(
                 user_id,
             )
 
             # Copy direct message state if applicable
-            if user_account_data and "m.direct" in user_account_data[0]:
-                direct_rooms = user_account_data[0]["m.direct"]
+            if user_account_data and "m.direct" in user_account_data:
+                direct_rooms = user_account_data["m.direct"]
 
                 # Check which key this room is under
                 for key, room_id_list in direct_rooms.items():