summaryrefslogtreecommitdiffstats
path: root/bridge/telegram/telegram.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-04-17 23:26:41 +0200
committerWim <wim@42.be>2018-04-17 23:26:41 +0200
commite57f3a7e6c9435cba74109fffd402216fcb80fe6 (patch)
treec077d6f7dc7077912e1ebbff8a2ed6dc9f620ef0 /bridge/telegram/telegram.go
parent68fbed92819f83e282af6394e568446b63158257 (diff)
downloadmatterbridge-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.go11
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 {