summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorKatie Wolfe <katie@dnaf.moe>2019-04-22 12:59:00 -0400
committerKatie Wolfe <katie@dnaf.moe>2019-04-24 12:26:53 -0400
commit5d3ed79944d47f0c9d9c040bf71530eade23e19c (patch)
treeb512f8ed552311233e870da8ea990c58028bf80f /synapse
parentAdd full stop to 5084.bugfix (diff)
downloadsynapse-5d3ed79944d47f0c9d9c040bf71530eade23e19c.tar.xz
Show heroes if room name or canonical alias are empty
Fixes #4194

Signed-off-by: Katie Wolfe <katie@dnaf.moe>
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/sync.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index f1a436011e..b3e6be6dd2 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -583,17 +583,18 @@ class SyncHandler(object):
         )
 
         # if the room has a name or canonical_alias set, we can skip
-        # calculating heroes.
+        # calculating heroes. Empty strings are falsey, so we check
+        # for the "name" value and default to an empty string.
         if name_id:
             name = yield self.store.get_event(name_id, allow_none=True)
-            if name and name.content and name.content.name:
+            if name and name.content and "name" in name.content and name.content.get("name", ""):
                 defer.returnValue(summary)
 
         if canonical_alias_id:
             canonical_alias = yield self.store.get_event(
                 canonical_alias_id, allow_none=True,
             )
-            if canonical_alias and canonical_alias.content and canonical_alias.content.alias:
+            if canonical_alias and canonical_alias.content and canonical_alias.content.get("alias", ""):
                 defer.returnValue(summary)
 
         joined_user_ids = [