summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/telegram.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-06-18 23:59:52 +0200
committerWim <wim@42.be>2017-06-18 23:59:52 +0200
commit62e9de1a3b79e57d884dcec8ef22ed6db2dc0df0 (patch)
tree8ef114f729f494897ee58b1da5455ba88e8b3785 /bridge/telegram/telegram.go
parent2ddc4f7ae91a51bc8fa279fdab3c7d64600e1a25 (diff)
downloadmatterbridge-msglm-62e9de1a3b79e57d884dcec8ef22ed6db2dc0df0.tar.gz
matterbridge-msglm-62e9de1a3b79e57d884dcec8ef22ed6db2dc0df0.tar.bz2
matterbridge-msglm-62e9de1a3b79e57d884dcec8ef22ed6db2dc0df0.zip
Use the last (and biggest) photo to relay (telegram). Closes #184
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r--bridge/telegram/telegram.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index 9f7af284..48ad672a 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -122,10 +122,8 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
}
if message.Photo != nil {
photos := *message.Photo
- // photo 3 is the biggest
- if len(photos) == 3 {
- text = text + " " + b.getFileDirectURL(photos[2].FileID)
- }
+ // last photo is the biggest
+ text = text + " " + b.getFileDirectURL(photos[len(photos)-1].FileID)
}
if message.Document != nil {
text = text + " " + message.Document.FileName + " : " + b.getFileDirectURL(message.Document.FileID)