Avoids creating invalid url when the user doesn't have an avatar.

This commit is contained in:
tfve
2020-05-08 00:24:52 +01:00
committed by Tiago Epifânio
parent 52a071e34d
commit 7a86876b4f

View File

@@ -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
}