Skip to content

Commit

Permalink
Show heroes if room name or canonical alias are empty
Browse files Browse the repository at this point in the history
Fixes matrix-org#4194

Signed-off-by: Katie Wolfe <[email protected]>
  • Loading branch information
k80w committed Apr 24, 2019
1 parent 60041ea commit 5d3ed79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,17 +583,18 @@ def compute_summary(self, room_id, sync_config, batch, state, now_token):
)

# 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 = [
Expand Down

0 comments on commit 5d3ed79

Please sign in to comment.