summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/handlers.go
diff options
context:
space:
mode:
authorAlexander <emu.sas@gmail.com>2022-03-25 23:58:52 +0300
committerGitHub <noreply@github.com>2022-03-25 21:58:52 +0100
commit5d9604cd15513dce2244f0a4d2f8e67a6ee22455 (patch)
treea5b6eb2ad20e9d5e248ded9514a171bb3a1cc260 /bridge/telegram/handlers.go
parentcc36ebf1c9191a6107637b26bd3dbc802f91eb4a (diff)
downloadmatterbridge-msglm-5d9604cd15513dce2244f0a4d2f8e67a6ee22455.tar.gz
matterbridge-msglm-5d9604cd15513dce2244f0a4d2f8e67a6ee22455.tar.bz2
matterbridge-msglm-5d9604cd15513dce2244f0a4d2f8e67a6ee22455.zip
Preserve threading from telegram replies (telegram) (#1776)
* Preserve threading from telegram replies * Add fallback for unthreaded telegram message * Fix linter issue
Diffstat (limited to 'bridge/telegram/handlers.go')
-rw-r--r--bridge/telegram/handlers.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go
index d9b104a3..6267c12b 100644
--- a/bridge/telegram/handlers.go
+++ b/bridge/telegram/handlers.go
@@ -199,6 +199,11 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
rmsg.ID = strconv.Itoa(message.MessageID)
rmsg.Channel = strconv.FormatInt(message.Chat.ID, 10)
+ // preserve threading from telegram reply
+ if message.ReplyToMessage != nil {
+ rmsg.ParentID = strconv.Itoa(message.ReplyToMessage.MessageID)
+ }
+
// handle entities (adding URLs)
b.handleEntities(&rmsg, message)