diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index df3d6f8f..be95b160 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -187,6 +187,9 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { rmsg.ID = strconv.Itoa(message.MessageID) rmsg.Channel = strconv.FormatInt(message.Chat.ID, 10) + // handle entities (adding URLs) + b.handleEntities(&rmsg, message) + // handle username b.handleUsername(&rmsg, message) @@ -202,9 +205,6 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { // quote the previous message b.handleQuoting(&rmsg, message) - // handle entities (adding URLs) - b.handleEntities(&rmsg, message) - if rmsg.Text != "" || len(rmsg.Extra) > 0 { // Comment the next line out due to avoid removing empty lines in Telegram // rmsg.Text = helper.RemoveEmptyNewLines(rmsg.Text)