From cec63546ff3dd8fa375ccda486929df5bbf50bbb Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 4 Sep 2020 22:50:57 +0200 Subject: Check location of avatarURL (zulip). Fixes #1214 (#1227) --- bridge/zulip/zulip.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bridge/zulip') 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) -- cgit v1.2.3