diff options
author | Wim <wim@42.be> | 2018-04-29 22:31:11 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2018-04-29 22:31:11 +0200 |
commit | b24a47ad7fb6950d19cb160ede1d3804f66e9928 (patch) | |
tree | a1bc8933a721ac0eecce2364f5f11a6612ca6f20 /bridge | |
parent | cd1fd1bb7c926f5f78334d08ade7e395cac87247 (diff) | |
download | matterbridge-msglm-b24a47ad7fb6950d19cb160ede1d3804f66e9928.tar.gz matterbridge-msglm-b24a47ad7fb6950d19cb160ede1d3804f66e9928.tar.bz2 matterbridge-msglm-b24a47ad7fb6950d19cb160ede1d3804f66e9928.zip |
Handle channel posts correctly (telegram)
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/telegram/telegram.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 93ccb2f4..c958aba2 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -121,7 +121,7 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { for update := range updates { b.Log.Debugf("== Receiving event: %#v", update.Message) - if update.Message == nil && update.ChannelPost == nil { + if update.Message == nil && update.ChannelPost == nil && update.EditedMessage == nil && update.EditedChannelPost == nil { b.Log.Error("Getting nil messages, this shouldn't happen.") continue } @@ -133,6 +133,7 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { // handle channels if update.ChannelPost != nil { message = update.ChannelPost + rmsg.Text = message.Text } // edited channel message @@ -144,6 +145,7 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { // handle groups if update.Message != nil { message = update.Message + rmsg.Text = message.Text } // edited group message @@ -168,7 +170,6 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { rmsg.Username = message.From.FirstName } } - rmsg.Text += message.Text // only download avatars if we have a place to upload them (configured mediaserver) if b.General.MediaServerUpload != "" { b.handleDownloadAvatar(message.From.ID, rmsg.Channel) |