summary refs log tree commit diff
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:29 -0400
commit7f025eb425bae8a48b25a230d17c25ccb67cbe2d (patch)
treeca37481d9832525d9399e4c5c7143c472447f009
parentMerge pull request #5077 from matrix-org/babolivier/account_expiration (diff)
downloadsynapse-7f025eb425bae8a48b25a230d17c25ccb67cbe2d.tar.xz
Show heroes if room name or canonical alias are empty
Fixes #4194

Signed-off-by: Katie Wolfe <katie@dnaf.moe>
-rw-r--r--synapse/handlers/sync.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py
index 153312e39f..f1a436011e 100644
--- a/synapse/handlers/sync.py
+++ b/synapse/handlers/sync.py
@@ -583,19 +583,17 @@ class SyncHandler(object):
         )
 
         # if the room has a name or canonical_alias set, we can skip
-        # calculating heroes.  we assume that if the event has contents, it'll
-        # be a valid name or canonical_alias - i.e. we're checking that they
-        # haven't been "deleted" by blatting {} over the top.
+        # calculating heroes.
         if name_id:
             name = yield self.store.get_event(name_id, allow_none=True)
-            if name and name.content:
+            if name and name.content and name.content.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:
+            if canonical_alias and canonical_alias.content and canonical_alias.content.alias:
                 defer.returnValue(summary)
 
         joined_user_ids = [