mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: also include category in to field when mocking post for federation
This commit is contained in:
@@ -557,7 +557,6 @@ Mocks.notes.public = async (post) => {
|
|||||||
const published = post.timestampISO;
|
const published = post.timestampISO;
|
||||||
const updated = post.edited ? post.editedISO : null;
|
const updated = post.edited ? post.editedISO : null;
|
||||||
|
|
||||||
// todo: post visibility
|
|
||||||
const to = new Set([activitypub._constants.publicAddress]);
|
const to = new Set([activitypub._constants.publicAddress]);
|
||||||
const cc = new Set([`${nconf.get('url')}/uid/${post.user.uid}/followers`]);
|
const cc = new Set([`${nconf.get('url')}/uid/${post.user.uid}/followers`]);
|
||||||
|
|
||||||
@@ -728,6 +727,7 @@ Mocks.notes.public = async (post) => {
|
|||||||
audience = post.audience || audience;
|
audience = post.audience || audience;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
to.add(audience);
|
||||||
|
|
||||||
let object = {
|
let object = {
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
|||||||
const hasTid = !!tid;
|
const hasTid = !!tid;
|
||||||
|
|
||||||
const cid = hasTid ? await topics.getTopicField(tid, 'cid') : options.cid || -1;
|
const cid = hasTid ? await topics.getTopicField(tid, 'cid') : options.cid || -1;
|
||||||
|
|
||||||
if (options.cid && cid === -1) {
|
if (options.cid && cid === -1) {
|
||||||
// Move topic if currently uncategorized
|
// Move topic if currently uncategorized
|
||||||
await topics.tools.move(tid, { cid: options.cid, uid: 'system' });
|
await topics.tools.move(tid, { cid: options.cid, uid: 'system' });
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ module.exports = function (Categories) {
|
|||||||
Categories.getPinnedTids({ ...data, start: 0, stop: -1 }),
|
Categories.getPinnedTids({ ...data, start: 0, stop: -1 }),
|
||||||
Categories.buildTopicsSortedSet(data),
|
Categories.buildTopicsSortedSet(data),
|
||||||
]);
|
]);
|
||||||
console.log(set);
|
|
||||||
|
|
||||||
const totalPinnedCount = pinnedTids.length;
|
const totalPinnedCount = pinnedTids.length;
|
||||||
const pinnedTidsOnPage = pinnedTids.slice(data.start, data.stop !== -1 ? data.stop + 1 : undefined);
|
const pinnedTidsOnPage = pinnedTids.slice(data.start, data.stop !== -1 ? data.stop + 1 : undefined);
|
||||||
|
|||||||
Reference in New Issue
Block a user