From 07885f5810935d56a05d7d5f5c7147f9a9e4558e Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 27 May 2018 22:30:17 +0200 Subject: Fix iconurl regression (mattermost,slack,rocketchat). Closes #430 --- bridge/mattermost/mattermost.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bridge/mattermost') diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go index 51d32424..ae5d9db7 100644 --- a/bridge/mattermost/mattermost.go +++ b/bridge/mattermost/mattermost.go @@ -368,7 +368,8 @@ func (b *Bmattermost) sendWebhook(msg config.Message) (string, error) { if msg.Extra != nil { // this sends a message only if we received a config.EVENT_FILE_FAILURE_SIZE for _, rmsg := range helper.HandleExtra(&msg, b.General) { - matterMessage := matterhook.OMessage{IconURL: b.GetString("IconURL"), Channel: rmsg.Channel, UserName: rmsg.Username, Text: rmsg.Text, Props: make(map[string]interface{})} + iconURL := config.GetIconURL(&rmsg, b.GetString("iconurl")) + matterMessage := matterhook.OMessage{IconURL: iconURL, Channel: rmsg.Channel, UserName: rmsg.Username, Text: rmsg.Text, Props: make(map[string]interface{})} matterMessage.Props["matterbridge_"+b.uuid] = true b.mh.Send(matterMessage) } @@ -384,7 +385,8 @@ func (b *Bmattermost) sendWebhook(msg config.Message) (string, error) { } } - matterMessage := matterhook.OMessage{IconURL: b.GetString("IconURL"), Channel: msg.Channel, UserName: msg.Username, Text: msg.Text, Props: make(map[string]interface{})} + iconURL := config.GetIconURL(&msg, b.GetString("iconurl")) + matterMessage := matterhook.OMessage{IconURL: iconURL, Channel: msg.Channel, UserName: msg.Username, Text: msg.Text, Props: make(map[string]interface{})} if msg.Avatar != "" { matterMessage.IconURL = msg.Avatar } -- cgit v1.2.3