From 8cc78c1053dc95016d88dcae0cbc3e7d6088fc15 Mon Sep 17 00:00:00 2001 From: Alexander Korelskiy Date: Wed, 23 Mar 2022 17:39:20 +0300 Subject: [PATCH] Add fallback for unthreaded telegram message --- bridge/telegram/telegram.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 75c28030..8d10114d 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -1,6 +1,7 @@ package btelegram import ( + "fmt" "html" "log" "strconv" @@ -108,6 +109,12 @@ func (b *Btelegram) Send(msg config.Message) (string, error) { return b.handleDelete(&msg, chatid) } + // Handle prefix hint for unthreaded messages. + if msg.ParentNotFound() { + msg.ParentID = "" + msg.Text = fmt.Sprintf("[reply]: %s", msg.Text) + } + // Upload a file if it exists if msg.Extra != nil { for _, rmsg := range helper.HandleExtra(&msg, b.General) {