summaryrefslogtreecommitdiffstats
path: root/bridge/telegram
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-04-19 12:53:49 +0200
committerWim <wim@42.be>2018-04-19 12:53:49 +0200
commita83831e68d47a83775ab54539ddf4fd776576fa7 (patch)
tree38249966035eb8f815884a9e4b80bc5645d5e802 /bridge/telegram
parenta12a8d4fe2d2f38074278396870085684f9548ca (diff)
downloadmatterbridge-msglm-a83831e68d47a83775ab54539ddf4fd776576fa7.tar.gz
matterbridge-msglm-a83831e68d47a83775ab54539ddf4fd776576fa7.tar.bz2
matterbridge-msglm-a83831e68d47a83775ab54539ddf4fd776576fa7.zip
Remove empty newlines from messages (telegram) #399
Diffstat (limited to 'bridge/telegram')
-rw-r--r--bridge/telegram/telegram.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/bridge/telegram/telegram.go b/bridge/telegram/telegram.go
index d2f229f8..ee7309ed 100644
--- a/bridge/telegram/telegram.go
+++ b/bridge/telegram/telegram.go
@@ -222,18 +222,12 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
usernameReply = "unknown"
}
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 + ")"
+ rmsg.Text = rmsg.Text + " (re @" + usernameReply + ":" + message.ReplyToMessage.Text + ")"
}
}
if rmsg.Text != "" || len(rmsg.Extra) > 0 {
+ rmsg.Text = helper.RemoveEmptyNewLines(rmsg.Text)
rmsg.Avatar = helper.GetAvatar(b.avatarMap, strconv.Itoa(message.From.ID), b.General)
b.Log.Debugf("<= Sending message from %s on %s to gateway", rmsg.Username, b.Account)