mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
refactor: use a helper to resolve actor URI
This commit is contained in:
@@ -234,21 +234,7 @@ ActivityPub.send = async (type, id, targets, payload) => {
|
|||||||
|
|
||||||
const inboxes = await ActivityPub.resolveInboxes(targets);
|
const inboxes = await ActivityPub.resolveInboxes(targets);
|
||||||
|
|
||||||
let actor;
|
const actor = ActivityPub.helpers.resolveActor(type, id);
|
||||||
switch (type) {
|
|
||||||
case 'uid': {
|
|
||||||
actor = `${nconf.get('url')}${id > 0 ? `/uid/${id}` : '/actor'}`;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 'cid': {
|
|
||||||
actor = `${nconf.get('url')}/category/${id}`;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new Error('[[error:activitypub.invalid-id]]');
|
|
||||||
}
|
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
|
|||||||
Reference in New Issue
Block a user