From 2fa96ec0ed5d78357a11dee158cac9a9e6d7090d Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 6 May 2022 23:32:25 +0200 Subject: Add KeepQuotedReply option for matrix to fix regression (#1823) Matrix quotes replies and as of matterbridge 1.24.0 we strip those as this causes issues with bridges support threading and have PreserveThreading enabled. Introduced via https://github.com/42wim/matterbridge/commit/9a8ce9b17e560433731eb5efa3cee7ced0b93605 But if you for example use mattermost or discord with webhooks you'll need to enable this if you want something that looks like a reply from matrix. See issues: - https://github.com/42wim/matterbridge/issues/1819 - https://github.com/42wim/matterbridge/issues/1780 --- bridge/matrix/matrix.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'bridge/matrix') diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index a2525358..702f4c8d 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -428,12 +428,15 @@ func (b *Bmatrix) handleReply(ev *matrix.Event, rmsg config.Message) bool { } body := rmsg.Text - for strings.HasPrefix(body, "> ") { - lineIdx := strings.IndexRune(body, '\n') - if lineIdx == -1 { - body = "" - } else { - body = body[(lineIdx + 1):] + + if !b.GetBool("keepquotedreply") { + for strings.HasPrefix(body, "> ") { + lineIdx := strings.IndexRune(body, '\n') + if lineIdx == -1 { + body = "" + } else { + body = body[(lineIdx + 1):] + } } } -- cgit v1.2.3