diff options
author | Wim <wim@42.be> | 2020-09-04 22:50:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 22:50:57 +0200 |
commit | cec63546ff3dd8fa375ccda486929df5bbf50bbb (patch) | |
tree | 6f4830f3f20c74505d2ecefd229b4867396ad4e9 /bridge/zulip/zulip.go | |
parent | 75f67d2de41de063c1fdfaee349b11929eca47eb (diff) | |
download | matterbridge-msglm-cec63546ff3dd8fa375ccda486929df5bbf50bbb.tar.gz matterbridge-msglm-cec63546ff3dd8fa375ccda486929df5bbf50bbb.tar.bz2 matterbridge-msglm-cec63546ff3dd8fa375ccda486929df5bbf50bbb.zip |
Check location of avatarURL (zulip). Fixes #1214 (#1227)
Diffstat (limited to 'bridge/zulip/zulip.go')
-rw-r--r-- | bridge/zulip/zulip.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bridge/zulip/zulip.go b/bridge/zulip/zulip.go index 9fcc54af..e66558a2 100644 --- a/bridge/zulip/zulip.go +++ b/bridge/zulip/zulip.go @@ -135,13 +135,19 @@ func (b *Bzulip) handleQueue() error { if m.SenderEmail == b.GetString("login") { continue } + + avatarURL := m.AvatarURL + if !strings.HasPrefix(avatarURL, "http") { + avatarURL = b.GetString("server") + avatarURL + } + rmsg := config.Message{ Username: m.SenderFullName, Text: m.Content, Channel: b.getChannel(m.StreamID) + "/topic:" + m.Subject, Account: b.Account, UserID: strconv.Itoa(m.SenderID), - Avatar: m.AvatarURL, + Avatar: avatarURL, } b.Log.Debugf("<= Sending message from %s on %s to gateway", rmsg.Username, b.Account) b.Log.Debugf("<= Message is %#v", rmsg) |