1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

MessageLinkEmbeds: Add limit for nested links

This commit is contained in:
Nuckyz 2024-05-19 03:54:31 -03:00 committed by Luna
parent 79c790cf14
commit bca8c0ba8b

View file

@ -227,10 +227,8 @@ function MessageEmbedAccessory({ message }: { message: Message; }) {
const accessories = [] as (JSX.Element | null)[];
let match = null as RegExpMatchArray | null;
while ((match = messageLinkRegex.exec(message.content!)) !== null) {
const [_, channelID, messageID] = match;
if (embeddedBy.includes(messageID)) {
for (const [_, channelID, messageID] of message.content!.matchAll(messageLinkRegex)) {
if (embeddedBy.includes(messageID) || embeddedBy.length > 2) {
continue;
}