refactor: use a helper to resolve actor URI

This commit is contained in:
Opliko
2024-04-09 23:58:25 +02:00
parent 102c174e03
commit b921f8d167

View File

@@ -234,21 +234,7 @@ ActivityPub.send = async (type, id, targets, payload) => {
const inboxes = await ActivityPub.resolveInboxes(targets);
let actor;
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]]');
}
const actor = ActivityPub.helpers.resolveActor(type, id);
payload = {
'@context': 'https://www.w3.org/ns/activitystreams',