summaryrefslogtreecommitdiffstats
path: root/bridge/matrix/matrix.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-02-01 00:41:09 +0100
committerWim <wim@42.be>2018-02-01 00:41:09 +0100
commit7764493298760ec8d33f5387ea2fb6c4705a407e (patch)
treed6ec7e7770780f5ac3f12985b1691dfa792e3646 /bridge/matrix/matrix.go
parent64a20ee61b47e8df982152bfc87a8bb798f009d9 (diff)
downloadmatterbridge-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/matrix/matrix.go')
-rw-r--r--bridge/matrix/matrix.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go
index d659aaa2..06c52148 100644
--- a/bridge/matrix/matrix.go
+++ b/bridge/matrix/matrix.go
@@ -107,6 +107,12 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) {
mtype := mime.TypeByExtension("." + sp[len(sp)-1])
if strings.Contains(mtype, "image") ||
strings.Contains(mtype, "video") {
+ if fi.Comment != "" {
+ resp, err := b.mc.SendText(channel, msg.Username+fi.Comment)
+ if err != nil {
+ flog.Errorf("file comment failed: %#v", err)
+ }
+ }
flog.Debugf("uploading file: %s %s", fi.Name, mtype)
res, err := b.mc.UploadToContentRepo(content, mtype, int64(len(*fi.Data)))
if err != nil {