Add notice to messages that contain components
This commit is contained in:
@@ -917,6 +917,8 @@ const msgInteractionTemplateHTML = `<blockquote>
|
||||
<a href="https://matrix.to/#/%s">%s</a> used <font color="#3771bb">/%s</font>
|
||||
</blockquote>`
|
||||
|
||||
const msgComponentTemplateHTML = `<p>This message contains interactive elements. Use the Discord app to interact with the message.</p>`
|
||||
|
||||
func (portal *Portal) convertDiscordTextMessage(intent *appservice.IntentAPI, msg *discordgo.Message, relation *event.RelatesTo, isEdit bool) *ConvertedMessage {
|
||||
var htmlParts []string
|
||||
if msg.Interaction != nil {
|
||||
@@ -941,6 +943,10 @@ func (portal *Portal) convertDiscordTextMessage(intent *appservice.IntentAPI, ms
|
||||
}
|
||||
}
|
||||
|
||||
if len(msg.Components) > 0 {
|
||||
htmlParts = append(htmlParts, msgComponentTemplateHTML)
|
||||
}
|
||||
|
||||
if len(htmlParts) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user