mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-08 08:32:53 +01:00
fix: send actor with 1b12 announce, fixes #13072
This commit is contained in:
@@ -4,6 +4,7 @@ const nconf = require('nconf');
|
|||||||
const winston = require('winston');
|
const winston = require('winston');
|
||||||
|
|
||||||
const posts = require('../posts');
|
const posts = require('../posts');
|
||||||
|
const utils = require('../utils');
|
||||||
|
|
||||||
const activitypub = module.parent.exports;
|
const activitypub = module.parent.exports;
|
||||||
const Feps = module.exports;
|
const Feps = module.exports;
|
||||||
@@ -14,6 +15,7 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
({ id: localId } = await activitypub.helpers.resolveLocalId(id));
|
({ id: localId } = await activitypub.helpers.resolveLocalId(id));
|
||||||
}
|
}
|
||||||
const cid = await posts.getCidByPid(localId || id);
|
const cid = await posts.getCidByPid(localId || id);
|
||||||
|
const uid = await posts.getPostField(localId || id, 'uid');
|
||||||
|
|
||||||
const followers = await activitypub.notes.getCategoryFollowers(cid);
|
const followers = await activitypub.notes.getCategoryFollowers(cid);
|
||||||
if (!followers.length) {
|
if (!followers.length) {
|
||||||
@@ -29,6 +31,7 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
await activitypub.send('cid', cid, followers, {
|
await activitypub.send('cid', cid, followers, {
|
||||||
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${Date.now()}`,
|
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${Date.now()}`,
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
|
actor: utils.isNumber(uid) ? `${nconf.get('url')}/uid/${uid}` : uid,
|
||||||
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
||||||
cc: [actor, activitypub._constants.publicAddress],
|
cc: [actor, activitypub._constants.publicAddress],
|
||||||
object: activity,
|
object: activity,
|
||||||
|
|||||||
Reference in New Issue
Block a user