mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 14:00:29 +01:00
fix: broken category urls in to, cc
This commit is contained in:
@@ -46,6 +46,12 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
targets.unshift(actor);
|
targets.unshift(actor);
|
||||||
}
|
}
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
const to = [localCid ? `${nconf.get('url')}/category/${cid}/followers` : cid];
|
||||||
|
const cc = [activitypub._constants.publicAddress];
|
||||||
|
if (localCid) {
|
||||||
|
cc.unshift(actor);
|
||||||
|
}
|
||||||
|
|
||||||
if (activity.type === 'Create') {
|
if (activity.type === 'Create') {
|
||||||
const isMain = await posts.isMain(localId || id);
|
const isMain = await posts.isMain(localId || id);
|
||||||
if (isMain) {
|
if (isMain) {
|
||||||
@@ -53,9 +59,9 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
||||||
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now}`,
|
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now}`,
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
actor: `${nconf.get('url')}/category/${cid}`,
|
actor: localCid ? `${nconf.get('url')}/category/${cid}` : `${nconf.get('url')}/actor`,
|
||||||
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
to,
|
||||||
cc: [actor, activitypub._constants.publicAddress],
|
cc,
|
||||||
object: activity.object,
|
object: activity.object,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -65,9 +71,9 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
||||||
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now + 1}`,
|
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now + 1}`,
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
actor: `${nconf.get('url')}/category/${cid}`,
|
actor: localCid ? `${nconf.get('url')}/category/${cid}` : `${nconf.get('url')}/actor`,
|
||||||
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
to,
|
||||||
cc: [actor, activitypub._constants.publicAddress],
|
cc,
|
||||||
object: activity,
|
object: activity,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user