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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user