fix: send actor uris in follow instead of webfinger ids

This commit is contained in:
Julian Lam
2023-12-22 13:56:18 -05:00
parent f3b0794d17
commit 543daee866
2 changed files with 4 additions and 9 deletions

View File

@@ -172,10 +172,7 @@ ActivityPub.send = async (uid, targets, payload) => {
payload = {
'@context': 'https://www.w3.org/ns/activitystreams',
actor: {
type: 'Person',
name: `${userslug}@${nconf.get('url_parsed').host}`,
},
actor: `${nconf.get('url')}/user/${userslug}`,
...payload,
};

View File

@@ -14,16 +14,14 @@ const activitypub = require('../activitypub');
const activitypubApi = module.exports;
activitypubApi.follow = async (caller, { actorId } = {}) => {
if (!actorId) {
const object = activitypub.getActor(actorId);
if (!object) {
throw new Error('[[error:invalid-uid]]'); // should be activitypub-specific
}
await activitypub.send(caller.uid, actorId, {
type: 'Follow',
object: {
type: 'Person',
name: actorId,
},
object: object.actorUri,
});
const now = Date.now();