summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@protonmail.com>2022-11-20 16:36:36 -0500
committerPuyodead1 <puyodead@protonmail.com>2022-11-20 16:36:36 -0500
commit2f44691ff4e8314c06d5f3283d9644f6d30bea8b (patch)
tree117d1f3a57a285097755c83dfd629e158f05a35e /src/api
parentMerge pull request #891 from fosscord/dev/improve-security (diff)
downloadserver-ts-2f44691ff4e8314c06d5f3283d9644f6d30bea8b.tar.xz
fix
Diffstat (limited to 'src/api')
-rw-r--r--src/api/util/handlers/Message.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts

index d760d27c..fcba29b7 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts
@@ -148,13 +148,13 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { // TODO: cache link result in db export async function postHandleMessage(message: Message) { - let links = message.content?.match(LINK_REGEX); - if (!links) return; + const matches = message.content?.match(LINK_REGEX); + if (!matches) return; const data = { ...message }; data.embeds = data.embeds.filter((x) => x.type !== "link"); - links = links.slice(0, 20); // embed max 20 links — TODO: make this configurable with instance policies + const links = matches.slice(0, 20); // embed max 20 links — TODO: make this configurable with instance policies for (const link of links) { try {