Co-Authored-By: sadan <117494111+sadan4@users.noreply.github.com>
This commit is contained in:
thororen 2026-09-22 23:43:33 -04:00
parent 77f1c71e8c
commit 40b4f98cb3
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View file

@ -338,8 +338,8 @@ export default definePlugin({
{
// Call our function to decide whether the emoji link should be kept or not
predicate: () => settings.store.transformEmojis,
match: /1!==(\i)\.length\|\|1!==\i\.length/,
replace: (m, content) => `${m}||$self.shouldKeepEmojiLink(${content}[0])`
match: /(\i)=\(0,\i\.\i\)\((\i)\)(?=&&)(?<=\i=\1,\2=\(\i\?\?\i\)\.embeds.{0,50}?)/,
replace: (m, content, _embeds) => `${m} && !$self.shouldKeepEmojiLink(${content}[0])`
},
{
// Patch the rendered message content to add fake nitro emojis or remove sticker links

View file

@ -15,7 +15,8 @@ export default definePlugin({
patches: [
{
find: "unknownUserMentionPlaceholder:",
// small util file
find: "={linkCount:0,onlyLinks:!1};function ",
replacement: {
// SimpleEmbedTypes.has(embed.type) && isEmbedInline(embed)
match: /\i\.has\(\i\.type\)&&\(0,\i\.\i\)\(\i\)/,