mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-27 08:49:24 +00:00
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 9a8ce9b17e
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
This commit is contained in:
@ -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):]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user