Skip to content

Commit

Permalink
Avoids creating invalid url when the user doesn't have an avatar.
Browse files Browse the repository at this point in the history
  • Loading branch information
epif4nio authored and Tiago Epifânio committed May 8, 2020
1 parent 52a071e commit 7a86876
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bridge/matrix/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ func (b *Bmatrix) getAvatarURL(sender string) string {
return ""
}
url := strings.ReplaceAll(mxcURL, "mxc://", b.GetString("Server")+"/_matrix/media/r0/thumbnail/")
url += "?width=37&height=37&method=crop"
if url != "" {
url += "?width=37&height=37&method=crop"
}
return url
}

0 comments on commit 7a86876

Please sign in to comment.