summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-01-25 11:21:25 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2019-01-25 11:21:25 +0000
commit6f3fda79ce50059c314b9e1566007062045624b4 (patch)
tree3f186eb7cdf7516544020e3ea41bfafa699de0d0
parentMerge branch 'develop' of github.com:matrix-org/synapse into anoa/dm_room_upg... (diff)
downloadsynapse-6f3fda79ce50059c314b9e1566007062045624b4.tar.xz
Move room_tag declaration to be closer to its use
-rw-r--r--synapse/handlers/room_member.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index a340566bb0..67c601b696 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -261,13 +261,10 @@ class RoomMemberHandler(object):
         if "predecessor" in create_event["content"]:
             old_room_id = create_event["content"]["predecessor"]["room_id"]
 
-            # Retrieve room account data for predecessor room
+            # Retrieve user account data for predecessor room
             user_account_data = yield self.store.get_account_data_for_user(
                 user_id,
             )
-            room_tags = yield self.store.get_tags_for_room(
-                user_id, old_room_id,
-            )
 
             # Copy direct message state if applicable
             if user_account_data and "m.direct" in user_account_data[0]:
@@ -286,6 +283,10 @@ class RoomMemberHandler(object):
                         break
 
             # Copy room tags if applicable
+            room_tags = yield self.store.get_tags_for_room(
+                user_id, old_room_id,
+            )
+
             if room_tags:
                 # Copy each room tag to the new room
                 for tag in room_tags.keys():