summaryrefslogtreecommitdiffstats
path: root/bridge/matrix/matrix.go
diff options
context:
space:
mode:
authorTiago Epifânio <26820396+tfve@users.noreply.github.com>2020-05-10 23:21:56 +0100
committerGitHub <noreply@github.com>2020-05-11 00:21:56 +0200
commit70622343315f6755987d8cb56fb1b2302d07ce90 (patch)
tree46e6276b0561806879cb8f89f5ebe39ffaa47703 /bridge/matrix/matrix.go
parent97545695257b30bcaf80e1b64bbed6cce2303be6 (diff)
downloadmatterbridge-msglm-70622343315f6755987d8cb56fb1b2302d07ce90.tar.gz
matterbridge-msglm-70622343315f6755987d8cb56fb1b2302d07ce90.tar.bz2
matterbridge-msglm-70622343315f6755987d8cb56fb1b2302d07ce90.zip
Avoid creating invalid url when the user doesn't have an avatar (matrix) (#1130)
Diffstat (limited to 'bridge/matrix/matrix.go')
-rw-r--r--bridge/matrix/matrix.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go
index 824870cf..78779c87 100644
--- a/bridge/matrix/matrix.go
+++ b/bridge/matrix/matrix.go
@@ -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
}