4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 16:39:24 +00:00

Add comment to file upload from telegram. Show comments on all bridges. Closes #358

This commit is contained in:
Wim
2018-02-01 00:41:09 +01:00
parent 64a20ee61b
commit 7764493298
6 changed files with 27 additions and 9 deletions

View File

@ -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})
}