Skip to content

Commit 4bbcc22

Browse files
committed
xmpp: replies: depend on <fallback> tags to split quote from message.
Most of this change is in the corresponding commit in go-xmpp.
1 parent a04cfd3 commit 4bbcc22

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

bridge/xmpp/xmpp.go

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,9 @@ func (b *Bxmpp) handleXMPP() error {
357357
if _parentID, ok := b.stanzaIDs.Get(v.Reply.ID); ok {
358358
parentID = _parentID
359359
}
360-
body := v.Text
361-
// Capture quoted lines into parentText so destination bridges can decide
362-
// how they should be displayed.
363-
for strings.HasPrefix(body, "> ") {
364-
lineIdx := strings.IndexRune(body, '\n')
365-
if lineIdx == -1 {
366-
parentText += body[2:]
367-
body = ""
368-
} else {
369-
parentText += body[2:lineIdx] + "\n"
370-
body = body[(lineIdx + 1):]
371-
}
372-
}
373-
parentText = strings.TrimRight(parentText, "\n")
374-
v.Text = body
360+
361+
// TODO: ignore XMPP quote and rely on a cross-bridge message cache (see https://github.com/matterbridge-org/matterbridge/issues/142)
362+
parentText = v.Reply.Quote
375363
}
376364

377365
rmsg := config.Message{

0 commit comments

Comments
 (0)