From 9c203327c07d8fd4161c47163f35dfea29ac83b1 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Sat, 12 Mar 2022 02:20:39 +0300 Subject: Fix Telegram channel title in forwards (#1753) Forward from channels requires different handling than forward from the regular users. This patch fixes the issue: it prints channel title instead of "forwarded from unknown". --- bridge/telegram/handlers.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bridge') diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index a27a6732..df3d6f8f 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -57,6 +57,11 @@ func (b *Btelegram) handleForwarded(rmsg *config.Message, message *tgbotapi.Mess return } + if message.ForwardFromChat != nil && message.ForwardFrom == nil { + rmsg.Text = "Forwarded from " + message.ForwardFromChat.Title + ": " + rmsg.Text + return + } + if message.ForwardFrom == nil { rmsg.Text = "Forwarded from " + unknownUser + ": " + rmsg.Text return -- cgit v1.2.3