summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/presentable_names.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/util/presentable_names.py b/synapse/util/presentable_names.py
index 2ae01e453d..f80a7fe58e 100644
--- a/synapse/util/presentable_names.py
+++ b/synapse/util/presentable_names.py
@@ -52,6 +52,9 @@ def calculate_room_name(room_state, user_id, fallback_to_members=True):
                 if len(the_aliases) > 0 and _looks_like_an_alias(the_aliases[0]):
                     return the_aliases[0]
 
+    if not fallback_to_members:
+        return None
+
     my_member_event = None
     if ("m.room.member", user_id) in room_state:
         my_member_event = room_state[("m.room.member", user_id)]
@@ -66,9 +69,6 @@ def calculate_room_name(room_state, user_id, fallback_to_members=True):
         else:
             return "Room Invite"
 
-    if not fallback_to_members:
-        return None
-
     # we're going to have to generate a name based on who's in the room,
     # so find out who is in the room that isn't the user.
     if "m.room.member" in room_state_bytype: