mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
fixup! web/timeline: render MSC4144 per-message profiles
Co-authored-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
parent
86f62facb4
commit
61286a3de4
1 changed files with 1 additions and 7 deletions
|
@ -81,13 +81,7 @@ function getFallbackCharacter(from: unknown, idx: number): string {
|
|||
export const getAvatarURL = (userID: UserID, content?: UserProfile | null): string | undefined => {
|
||||
const fallbackCharacter = getFallbackCharacter(content?.displayname, 0) || getFallbackCharacter(userID, 1)
|
||||
const backgroundColor = getUserColor(userID)
|
||||
let server: string | undefined
|
||||
let mediaID: string | undefined
|
||||
if (content?.avatar_file) {
|
||||
[server, mediaID] = parseMXC(content.avatar_file.url)
|
||||
} else {
|
||||
[server, mediaID] = parseMXC(content?.avatar_url)
|
||||
}
|
||||
const [server, mediaID] = parseMXC(content?.avatar_file?.url ?? content?.avatar_url)
|
||||
if (!mediaID) {
|
||||
return makeFallbackAvatar(backgroundColor, fallbackCharacter)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue