From e57f3a7e6c9435cba74109fffd402216fcb80fe6 Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 17 Apr 2018 23:26:41 +0200 Subject: Add QuoteDisable option (telegram). Closes #399 --- bridge/telegram/telegram.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'bridge/telegram') diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go index 7298c2d6..d2f229f8 100644 --- a/bridge/telegram/telegram.go +++ b/bridge/telegram/telegram.go @@ -221,7 +221,16 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) { if usernameReply == "" { usernameReply = "unknown" } - rmsg.Text = rmsg.Text + " (re @" + usernameReply + ":" + message.ReplyToMessage.Text + ")" + if !b.GetBool("QuoteDisable") { + rmsg.Text = rmsg.Text + " (re @" + usernameReply + ":" + // remove empty lines + for _, m := range strings.Split(message.ReplyToMessage.Text, "\n") { + if m != "" { + rmsg.Text = rmsg.Text + m + } + } + rmsg.Text = rmsg.Text + ")" + } } if rmsg.Text != "" || len(rmsg.Extra) > 0 { -- cgit v1.2.3