From 7ec95f786d55aab69541cb3065ea2c9b8eaf9c43 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 24 Nov 2017 22:55:24 +0100 Subject: Use mediaserver urls for irc,gitter and xmpp --- bridge/gitter/gitter.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bridge/gitter') diff --git a/bridge/gitter/gitter.go b/bridge/gitter/gitter.go index d8f1aa3d..64b6344f 100644 --- a/bridge/gitter/gitter.go +++ b/bridge/gitter/gitter.go @@ -125,6 +125,23 @@ func (b *Bgitter) Send(msg config.Message) (string, error) { } return "", nil } + + if msg.Extra != nil { + if len(msg.Extra["file"]) > 0 { + for _, f := range msg.Extra["file"] { + fi := f.(config.FileInfo) + if fi.URL != "" { + msg.Text = fi.URL + } + _, err := b.c.SendMessage(roomID, msg.Username+msg.Text) + if err != nil { + return "", err + } + } + return "", nil + } + } + resp, err := b.c.SendMessage(roomID, msg.Username+msg.Text) if err != nil { return "", err -- cgit v1.2.3