summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/telegram.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-02-03 01:11:11 +0100
committerWim <wim@42.be>2018-02-03 01:11:11 +0100
commit80822b7fff85647ad5852b00ec36d046959aed92 (patch)
treef3f15769f5b75b53f97c3bedf1bbf6a1f9a909c8 /bridge/telegram/telegram.go
parent78f1011f529981bab58556d9847488db04d00388 (diff)
downloadmatterbridge-msglm-80822b7fff85647ad5852b00ec36d046959aed92.tar.gz
matterbridge-msglm-80822b7fff85647ad5852b00ec36d046959aed92.tar.bz2
matterbridge-msglm-80822b7fff85647ad5852b00ec36d046959aed92.zip
Send chat notification if media is too big to be re-uploaded to MediaServer. See #359
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r--bridge/telegram/telegram.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index 99968ec9..6e78e819 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -97,6 +97,9 @@ func (b *Btelegram) Send(msg config.Message) (string, error) {
}
if msg.Extra != nil {
+ for _, rmsg := range helper.HandleExtra(&msg, b.General) {
+ b.sendMessage(chatid, rmsg.Username+rmsg.Text)
+ }
// check if we have files to upload (from slack, telegram or mattermost)
if len(msg.Extra["file"]) > 0 {
var c tgbotapi.Chattable
@@ -309,6 +312,10 @@ func (b *Btelegram) handleDownload(file interface{}, comment string, msg *config
flog.Debugf("download OK %#v %#v %#v", name, len(*data), len(url))
msg.Extra["file"] = append(msg.Extra["file"], config.FileInfo{Name: name, Data: data, Comment: comment})
}
+ } else {
+ flog.Errorf("File %#v to large to download (%#v). MediaDownloadSize is %#v", name, size, b.General.MediaDownloadSize)
+ msg.Event = config.EVENT_FILE_FAILURE_SIZE
+ msg.Extra[msg.Event] = append(msg.Extra[msg.Event], config.FileInfo{Name: name, Comment: comment, Size: int64(size)})
}
}