mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36: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 updated = post.edited ? post.editedISO : null;
|
||||
|
||||
// todo: post visibility
|
||||
const to = new Set([activitypub._constants.publicAddress]);
|
||||
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;
|
||||
});
|
||||
}
|
||||
to.add(audience);
|
||||
|
||||
let object = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
|
||||
@@ -79,6 +79,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
||||
const hasTid = !!tid;
|
||||
|
||||
const cid = hasTid ? await topics.getTopicField(tid, 'cid') : options.cid || -1;
|
||||
|
||||
if (options.cid && cid === -1) {
|
||||
// Move topic if currently uncategorized
|
||||
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.buildTopicsSortedSet(data),
|
||||
]);
|
||||
console.log(set);
|
||||
|
||||
const totalPinnedCount = pinnedTids.length;
|
||||
const pinnedTidsOnPage = pinnedTids.slice(data.start, data.stop !== -1 ? data.stop + 1 : undefined);
|
||||
|
||||
Reference in New Issue
Block a user