Skip to content
Snippets Groups Projects
Unverified Commit 2ac1abbc authored by Matthew Hodgson's avatar Matthew Hodgson Committed by GitHub
Browse files

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

parent fa0d464f
No related branches found
No related tags found
No related merge requests found
Show heroes if room name/canonical alias has been deleted
......@@ -562,8 +562,21 @@ class SyncHandler(object):
details.get(Membership.INVITE, empty_ms).count
)
if name_id or canonical_alias_id:
defer.returnValue(summary)
# 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.
if name_id:
name = yield self.store.get_event(name_id, allow_none=False)
if name and name.content:
defer.returnValue(summary)
if canonical_alias_id:
canonical_alias = yield self.store.get_event(
canonical_alias_id, allow_none=False,
)
if canonical_alias and canonical_alias.content:
defer.returnValue(summary)
joined_user_ids = [
r[0] for r in details.get(Membership.JOIN, empty_ms).members
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment