Don't add reply sender to mentions array manually
Discord already adds it to the native mentions array
This commit is contained in:
@@ -621,7 +621,7 @@ func isPlainGifMessage(msg *discordgo.Message) bool {
|
||||
(msg.Embeds[0].Type == discordgo.EmbedTypeImage && msg.Embeds[0].Image == nil && msg.Embeds[0].Thumbnail != nil))
|
||||
}
|
||||
|
||||
func (portal *Portal) convertDiscordMentions(msg *discordgo.Message, replySender id.UserID, syncGhosts bool) *event.Mentions {
|
||||
func (portal *Portal) convertDiscordMentions(msg *discordgo.Message, syncGhosts bool) *event.Mentions {
|
||||
var matrixMentions event.Mentions
|
||||
for _, mention := range msg.Mentions {
|
||||
puppet := portal.bridge.GetPuppetByID(mention.ID)
|
||||
@@ -635,9 +635,6 @@ func (portal *Portal) convertDiscordMentions(msg *discordgo.Message, replySender
|
||||
matrixMentions.UserIDs = append(matrixMentions.UserIDs, puppet.MXID)
|
||||
}
|
||||
}
|
||||
if replySender != "" {
|
||||
matrixMentions.UserIDs = append(matrixMentions.UserIDs, replySender)
|
||||
}
|
||||
slices.Sort(matrixMentions.UserIDs)
|
||||
matrixMentions.UserIDs = slices.Compact(matrixMentions.UserIDs)
|
||||
if msg.MentionEveryone {
|
||||
|
||||
Reference in New Issue
Block a user