Node.js based forum software built for the modern web
fix: send actor uris in follow instead of webfinger ids
Julian Lam543daee866a6
diff --git a/src/activitypub/index.js b/src/activitypub/index.jsindex c439821680..ff9dcf259c 100644--- a/src/activitypub/index.js+++ b/src/activitypub/index.js@@ -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,};diff --git a/src/api/activitypub.js b/src/api/activitypub.jsindex fd9f219e18..733a0cbcee 100644--- a/src/api/activitypub.js+++ b/src/api/activitypub.js@@ -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();