Node.js based forum software built for the modern web
fix: only process unique slugs
Barış Soner Uşaklı312df5239334
diff --git a/src/user/index.js b/src/user/index.jsindex 5e4c08e39f..df0fa13616 100644--- a/src/user/index.js+++ b/src/user/index.js@@ -128,8 +128,9 @@ User.getUidByUserslug = async function (userslug) {};User.getUidsByUserslugs = async function (userslugs) {- const apSlugs = userslugs.filter(slug => slug.includes('@'));- const normalSlugs = userslugs.filter(slug => !slug.includes('@'));+ const uniqueSlugs = _.uniq(userslugs);+ const apSlugs = uniqueSlugs.filter(slug => slug.includes('@'));+ const normalSlugs = uniqueSlugs.filter(slug => !slug.includes('@'));const slugToUid = Object.create(null);async function getApSlugs() {await Promise.all(apSlugs.map(slug => activitypub.actors.assert(slug)));