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

Allow specifying maximum download size of media using MediaDownloadSize (slack,telegram,matrix)

This commit is contained in:
Wim
2017-12-19 23:44:13 +01:00
parent 265457b451
commit d0c4fe78ee
5 changed files with 15 additions and 3 deletions

View File

@ -299,7 +299,7 @@ func (b *Btelegram) handleDownload(file interface{}, msg *config.Message) {
// if we have a file attached, download it (in memory) and put a pointer to it in msg.Extra
// limit to 1MB for now
flog.Debugf("trying to download %#v fileid %#v with size %#v", name, fileid, size)
if size <= 1000000 {
if size <= b.General.MediaDownloadSize {
data, err := helper.DownloadFile(url)
if err != nil {
flog.Errorf("download %s failed %#v", url, err)