mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 22:10:23 +01:00
fix: publish postingRestrictedToMods property in group actor
This commit is contained in:
@@ -13,6 +13,7 @@ const categories = require('../categories');
|
|||||||
const posts = require('../posts');
|
const posts = require('../posts');
|
||||||
const topics = require('../topics');
|
const topics = require('../topics');
|
||||||
const messaging = require('../messaging');
|
const messaging = require('../messaging');
|
||||||
|
const privileges = require('../privileges');
|
||||||
const plugins = require('../plugins');
|
const plugins = require('../plugins');
|
||||||
const slugify = require('../slugify');
|
const slugify = require('../slugify');
|
||||||
const translator = require('../translator');
|
const translator = require('../translator');
|
||||||
@@ -524,12 +525,19 @@ Mocks.actors.user = async (uid) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Mocks.actors.category = async (cid) => {
|
Mocks.actors.category = async (cid) => {
|
||||||
const {
|
const [
|
||||||
|
{
|
||||||
name, handle: preferredUsername, slug,
|
name, handle: preferredUsername, slug,
|
||||||
descriptionParsed: summary, backgroundImage,
|
descriptionParsed: summary, backgroundImage,
|
||||||
} = await categories.getCategoryFields(cid,
|
},
|
||||||
['name', 'handle', 'slug', 'description', 'descriptionParsed', 'backgroundImage']);
|
publicKey,
|
||||||
const publicKey = await activitypub.getPublicKey('cid', cid);
|
canPost,
|
||||||
|
] = await Promise.all([
|
||||||
|
categories.getCategoryFields(cid,
|
||||||
|
['name', 'handle', 'slug', 'description', 'descriptionParsed', 'backgroundImage']),
|
||||||
|
activitypub.getPublicKey('cid', cid),
|
||||||
|
privileges.categories.can('topics:create', cid, -2),
|
||||||
|
]);
|
||||||
|
|
||||||
let icon;
|
let icon;
|
||||||
if (backgroundImage) {
|
if (backgroundImage) {
|
||||||
@@ -567,6 +575,7 @@ Mocks.actors.category = async (cid) => {
|
|||||||
summary,
|
summary,
|
||||||
// image, // todo once categories have cover photos
|
// image, // todo once categories have cover photos
|
||||||
icon,
|
icon,
|
||||||
|
postingRestrictedToMods: !canPost,
|
||||||
|
|
||||||
publicKey: {
|
publicKey: {
|
||||||
id: `${nconf.get('url')}/category/${cid}#key`,
|
id: `${nconf.get('url')}/category/${cid}#key`,
|
||||||
|
|||||||
Reference in New Issue
Block a user