mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: send actor uris in follow instead of webfinger ids
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user