handlematrix: handle basic matrix rich text messages

Added the necessary room capabilities, too. Support for replies,
editing, deletion, and attachments are forthcoming.
This commit is contained in:
Skip R
2025-12-16 18:35:29 -08:00
parent 60171b4fca
commit d82b74fb29
5 changed files with 241 additions and 6 deletions

View File

@@ -37,8 +37,7 @@ const discordLinkPattern = `https?://[^<\p{Zs}\x{feff}]*[^"'),.:;\]\p{Zs}\x{feff
// don't contain < or whitespace anywhere, and don't end with "'),.:;]
//
// Zero-width whitespace is mostly in the Format category and is allowed, except \uFEFF isn't for some reason
// FIXME(skip): This will be unused until we port `escapeDiscordMarkdown`.
// var discordLinkRegex = regexp.MustCompile(discordLinkPattern)
var discordLinkRegex = regexp.MustCompile(discordLinkPattern)
var discordLinkRegexFull = regexp.MustCompile("^" + discordLinkPattern + "$")
func isActuallyLinkPreview(embed *discordgo.MessageEmbed) bool {