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>
|
<a href="https://matrix.to/#/%s">%s</a> used <font color="#3771bb">/%s</font>
|
||||||
</blockquote>`
|
</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 {
|
func (portal *Portal) convertDiscordTextMessage(intent *appservice.IntentAPI, msg *discordgo.Message, relation *event.RelatesTo, isEdit bool) *ConvertedMessage {
|
||||||
var htmlParts []string
|
var htmlParts []string
|
||||||
if msg.Interaction != nil {
|
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 {
|
if len(htmlParts) == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user