summaryrefslogtreecommitdiffstats
path: root/bridge/mattermost/mattermost.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/mattermost/mattermost.go')
-rw-r--r--bridge/mattermost/mattermost.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/bridge/mattermost/mattermost.go b/bridge/mattermost/mattermost.go
index 3ecaf6a5..e84e61f1 100644
--- a/bridge/mattermost/mattermost.go
+++ b/bridge/mattermost/mattermost.go
@@ -152,13 +152,24 @@ func (b *Bmattermost) Send(msg config.Message) (string, error) {
message = nick + message
}
if b.Config.WebhookURL != "" {
+
+ if msg.Extra != nil {
+ if len(msg.Extra["file"]) > 0 {
+ for _, f := range msg.Extra["file"] {
+ fi := f.(config.FileInfo)
+ if fi.URL != "" {
+ message += fi.URL
+ }
+ }
+ }
+ }
+
matterMessage := matterhook.OMessage{IconURL: b.Config.IconURL}
matterMessage.IconURL = msg.Avatar
matterMessage.Channel = channel
matterMessage.UserName = nick
matterMessage.Type = ""
matterMessage.Text = message
- matterMessage.Text = message
matterMessage.Props = make(map[string]interface{})
matterMessage.Props["matterbridge"] = true
err := b.mh.Send(matterMessage)