diff options
author | Wim <wim@42.be> | 2018-02-01 00:41:09 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2018-02-01 00:41:09 +0100 |
commit | 7764493298760ec8d33f5387ea2fb6c4705a407e (patch) | |
tree | d6ec7e7770780f5ac3f12985b1691dfa792e3646 /bridge/xmpp/xmpp.go | |
parent | 64a20ee61b47e8df982152bfc87a8bb798f009d9 (diff) | |
download | matterbridge-msglm-7764493298760ec8d33f5387ea2fb6c4705a407e.tar.gz matterbridge-msglm-7764493298760ec8d33f5387ea2fb6c4705a407e.tar.bz2 matterbridge-msglm-7764493298760ec8d33f5387ea2fb6c4705a407e.zip |
Add comment to file upload from telegram. Show comments on all bridges. Closes #358
Diffstat (limited to 'bridge/xmpp/xmpp.go')
-rw-r--r-- | bridge/xmpp/xmpp.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index 63a1048e..9c2eb2cc 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -84,8 +84,11 @@ func (b *Bxmpp) Send(msg config.Message) (string, error) { if len(msg.Extra["file"]) > 0 { for _, f := range msg.Extra["file"] { fi := f.(config.FileInfo) + if fi.Comment != "" { + msg.Text += fi.Comment + ":" + } if fi.URL != "" { - msg.Text = fi.URL + msg.Text += fi.URL } b.xc.Send(xmpp.Chat{Type: "groupchat", Remote: msg.Channel + "@" + b.Config.Muc, Text: msg.Username + msg.Text}) } |