diff options
author | Wim <wim@42.be> | 2018-04-17 23:26:41 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2018-04-17 23:26:41 +0200 |
commit | e57f3a7e6c9435cba74109fffd402216fcb80fe6 (patch) | |
tree | c077d6f7dc7077912e1ebbff8a2ed6dc9f620ef0 /bridge/telegram/telegram.go | |
parent | 68fbed92819f83e282af6394e568446b63158257 (diff) | |
download | matterbridge-msglm-e57f3a7e6c9435cba74109fffd402216fcb80fe6.tar.gz matterbridge-msglm-e57f3a7e6c9435cba74109fffd402216fcb80fe6.tar.bz2 matterbridge-msglm-e57f3a7e6c9435cba74109fffd402216fcb80fe6.zip |
Add QuoteDisable option (telegram). Closes #399
Diffstat (limited to 'bridge/telegram/telegram.go')
-rw-r--r-- | bridge/telegram/telegram.go | 11 |
1 files changed, 10 insertions, 1 deletions
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 { |