mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: only process unique slugs
This commit is contained in:
@@ -128,8 +128,9 @@ User.getUidByUserslug = async function (userslug) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
User.getUidsByUserslugs = async function (userslugs) {
|
User.getUidsByUserslugs = async function (userslugs) {
|
||||||
const apSlugs = userslugs.filter(slug => slug.includes('@'));
|
const uniqueSlugs = _.uniq(userslugs);
|
||||||
const normalSlugs = userslugs.filter(slug => !slug.includes('@'));
|
const apSlugs = uniqueSlugs.filter(slug => slug.includes('@'));
|
||||||
|
const normalSlugs = uniqueSlugs.filter(slug => !slug.includes('@'));
|
||||||
const slugToUid = Object.create(null);
|
const slugToUid = Object.create(null);
|
||||||
async function getApSlugs() {
|
async function getApSlugs() {
|
||||||
await Promise.all(apSlugs.map(slug => activitypub.actors.assert(slug)));
|
await Promise.all(apSlugs.map(slug => activitypub.actors.assert(slug)));
|
||||||
|
|||||||
Reference in New Issue
Block a user