diff --git a/bridge/config/config.go b/bridge/config/config.go index 18c60920..481a072c 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -156,6 +156,7 @@ type Protocol struct { SkipVersionCheck bool // mattermost StripNick bool // all protocols StripMarkdown bool // irc + StripQuote bool // telegram SyncTopic bool // slack TengoModifyMessage string // general Team string // mattermost, keybase diff --git a/bridge/telegram/handlers.go b/bridge/telegram/handlers.go index ad41354e..b8c340f8 100644 --- a/bridge/telegram/handlers.go +++ b/bridge/telegram/handlers.go @@ -114,6 +114,8 @@ func (b *Btelegram) handleQuoting(rmsg *config.Message, message *tgbotapi.Messag quote := message.ReplyToMessage.Text if quote == "" { quote = message.ReplyToMessage.Caption + } else if b.GetBool("StripQuote") { + quote = strings.ReplaceAll(quote, "\n", " ") } rmsg.Text = b.handleQuote(rmsg.Text, usernameReply, quote) } diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index 97b27d73..633814ec 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -1146,6 +1146,10 @@ ShowJoinPart=false #OPTIONAL (default false) StripNick=false +#Replace line breaks with spaces in quoted messages to avoid flooding +#OPTIONAL (default false) +StripQuote=false + #Enable to show topic changes from other bridges #Only works hiding/show topic changes from slack bridge for now #OPTIONAL (default false)