Node.js based forum software built for the modern web
fix: use setsAdd
Julian Lamd8e55d58de5f
diff --git a/src/activitypub/actors.js b/src/activitypub/actors.jsindex b9b1843a59..6516523849 100644--- a/src/activitypub/actors.js+++ b/src/activitypub/actors.js@@ -401,11 +401,11 @@ Actors.assertGroup = async (ids, options = {}) => {]);// Privilege mask- const masksAdd = categoryObjs.reduce((queries, category) => {+ const masksAdd = categoryObjs.reduce((sets, category) => {if (category?._activitypub?.postingRestrictedToMods) {- queries.push(db.setAdd.call(db, `cid:${category.cid}:privilegeMask`, 'topics:create'));+ sets.push(`cid:${category.cid}:privilegeMask`);}- return queries;+ return sets;}, []);await Promise.all([@@ -414,7 +414,7 @@ Actors.assertGroup = async (ids, options = {}) => {db.sortedSetAddBulk(queries.searchAdd),db.setObject('handle:cid', queries.handleAdd),_migratePersonToGroup(categoryObjs),- Promise.all(masksAdd),+ db.setsAdd(masksAdd, 'topics:create'),]);return categoryObjs;diff --git a/test/activitypub/privileges.js b/test/activitypub/privileges.jsindex c8158f1a0a..89fdb83245 100644--- a/test/activitypub/privileges.js+++ b/test/activitypub/privileges.js@@ -238,7 +238,6 @@ describe('Privilege masking', () => {it('should pass the privileges .can() check if requested', async () => {const set = await privileges.categories.get(cid, uid);- console.log(set);const can = await privileges.categories.can('topics:create', cid, uid);assert(can);});