Convert everyone/here into room and block other room mentions

This commit is contained in:
Tulir Asokan
2023-01-29 15:59:47 +02:00
parent 0f32f966b3
commit 254148f870
3 changed files with 115 additions and 6 deletions

View File

@@ -951,7 +951,12 @@ func (portal *Portal) convertDiscordTextMessage(intent *appservice.IntentAPI, ms
return nil
}
content := format.HTMLToContent(strings.Join(htmlParts, "\n"))
fullHTML := strings.Join(htmlParts, "\n")
if !msg.MentionEveryone {
fullHTML = strings.ReplaceAll(fullHTML, "@room", "@\u2063ro\u2063om")
}
content := format.HTMLToContent(fullHTML)
if relation != nil {
content.RelatesTo = relation.Copy()
}