Skip to content

Commit

Permalink
msgconv/matrixfmt: don't allow user mentions to fall back to links
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 20, 2024
1 parent 8b5835c commit aba7d8d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/msgconv/matrixfmt/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ func (parser *HTMLParser) textToElement(text string, ctx Context) slack.RichText
if userID != "" {
return slack.NewRichTextSectionUserElement(userID, ctx.StylePtr())
}
// Don't fall back to a link for mentions of unknown users
return slack.NewRichTextSectionTextElement(text, ctx.StylePtr())
} else if parsedMatrix.Sigil1 == '!' && parsedMatrix.Sigil2 == 0 {
channelID := parser.GetMentionedChannelID(parsedMatrix.RoomID(), ctx)
if channelID != "" {
Expand Down

0 comments on commit aba7d8d

Please sign in to comment.