From 5d9604cd15513dce2244f0a4d2f8e67a6ee22455 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 25 Mar 2022 23:58:52 +0300 Subject: Preserve threading from telegram replies (telegram) (#1776) * Preserve threading from telegram replies * Add fallback for unthreaded telegram message * Fix linter issue --- bridge/telegram/handlers.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bridge/telegram/handlers.go') 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) -- cgit v1.2.3