mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 00:56:13 +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 = {
|
payload = {
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
actor: {
|
actor: `${nconf.get('url')}/user/${userslug}`,
|
||||||
type: 'Person',
|
|
||||||
name: `${userslug}@${nconf.get('url_parsed').host}`,
|
|
||||||
},
|
|
||||||
...payload,
|
...payload,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -14,16 +14,14 @@ const activitypub = require('../activitypub');
|
|||||||
const activitypubApi = module.exports;
|
const activitypubApi = module.exports;
|
||||||
|
|
||||||
activitypubApi.follow = async (caller, { actorId } = {}) => {
|
activitypubApi.follow = async (caller, { actorId } = {}) => {
|
||||||
if (!actorId) {
|
const object = activitypub.getActor(actorId);
|
||||||
|
if (!object) {
|
||||||
throw new Error('[[error:invalid-uid]]'); // should be activitypub-specific
|
throw new Error('[[error:invalid-uid]]'); // should be activitypub-specific
|
||||||
}
|
}
|
||||||
|
|
||||||
await activitypub.send(caller.uid, actorId, {
|
await activitypub.send(caller.uid, actorId, {
|
||||||
type: 'Follow',
|
type: 'Follow',
|
||||||
object: {
|
object: object.actorUri,
|
||||||
type: 'Person',
|
|
||||||
name: actorId,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|||||||
Reference in New Issue
Block a user