Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

show heroes if a room has deleted name/canonical_alias #3851

Merged
merged 6 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3851.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Show heroes if room name/canonical alias has been deleted
11 changes: 9 additions & 2 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,15 @@ def compute_summary(self, room_id, sync_config, batch, state, now_token):
details.get(Membership.INVITE, empty_ms).count
)

if name_id or canonical_alias_id:
defer.returnValue(summary)
if name_id:
name = yield self.store.get_event(name_id)
if name.content:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to check that the returned event is not None

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, thanks

defer.returnValue(summary)

if canonical_alias_id:
canonical_alias = yield self.store.get_event(canonical_alias_id)
if canonical_alias.content:
defer.returnValue(summary)

joined_user_ids = [
r[0] for r in details.get(Membership.JOIN, empty_ms).members
Expand Down