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

Commit

Permalink
Handle not receiving a profile for a user in heroes
Browse files Browse the repository at this point in the history
  • Loading branch information
bradtgmurray committed Dec 29, 2022
1 parent d38aded commit 291630e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,13 +844,18 @@ async def compute_summary(
summary["m.heroes"],
)
summary["com.beeper.m.heroes"] = [
{"mxid": mxid, "display_name": profile.display_name}
{
"mxid": mxid,
"display_name": profile.display_name
if profile is not None
else None,
}
for mxid, profile in profiles.items()
if not mxid.startswith("@_") # filter out bot users
]
except Exception:
except Exception as e:
logger.warning(
f"Error generating heroes for room {room_id} profiles {profiles}"
f"Error generating heroes for room {room_id} profiles {profiles} error {e}"
)
raise

Expand Down

0 comments on commit 291630e

Please sign in to comment.