mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
event/reply: only remove plaintext reply fallback if there is one in HTML
This commit is contained in:
parent
bade596e49
commit
a973e5dc94
1 changed files with 6 additions and 5 deletions
|
|
@ -32,12 +32,13 @@ func TrimReplyFallbackText(text string) string {
|
|||
}
|
||||
|
||||
func (content *MessageEventContent) RemoveReplyFallback() {
|
||||
if len(content.RelatesTo.GetReplyTo()) > 0 && !content.replyFallbackRemoved {
|
||||
if content.Format == FormatHTML {
|
||||
content.FormattedBody = TrimReplyFallbackHTML(content.FormattedBody)
|
||||
if len(content.RelatesTo.GetReplyTo()) > 0 && !content.replyFallbackRemoved && content.Format == FormatHTML {
|
||||
origHTML := content.FormattedBody
|
||||
content.FormattedBody = TrimReplyFallbackHTML(content.FormattedBody)
|
||||
if content.FormattedBody != origHTML {
|
||||
content.Body = TrimReplyFallbackText(content.Body)
|
||||
content.replyFallbackRemoved = true
|
||||
}
|
||||
content.Body = TrimReplyFallbackText(content.Body)
|
||||
content.replyFallbackRemoved = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue