4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 16:39:24 +00:00

Add QuoteDisable option (telegram). Closes #399

This commit is contained in:
Wim
2018-04-17 23:26:41 +02:00
parent 68fbed9281
commit e57f3a7e6c
3 changed files with 15 additions and 1 deletions

View File

@ -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 {