mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	refactor: update ActivityPub.get and all methods calling it to take a uid so that requests can be signed
This commit is contained in:
		| @@ -17,7 +17,7 @@ const user = require('../user'); | ||||
| const activitypubApi = module.exports; | ||||
|  | ||||
| activitypubApi.follow = async (caller, { actorId } = {}) => { | ||||
| 	const object = await activitypub.getActor(actorId); | ||||
| 	const object = await activitypub.getActor(caller.uid, actorId); | ||||
| 	if (!object) { | ||||
| 		throw new Error('[[error:invalid-uid]]'); // should be activitypub-specific | ||||
| 	} | ||||
| @@ -29,7 +29,7 @@ activitypubApi.follow = async (caller, { actorId } = {}) => { | ||||
| }; | ||||
|  | ||||
| activitypubApi.unfollow = async (caller, { actorId }) => { | ||||
| 	const object = await activitypub.getActor(actorId); | ||||
| 	const object = await activitypub.getActor(caller.uid, actorId); | ||||
| 	const userslug = await user.getUserField(caller.uid, 'userslug'); | ||||
| 	if (!object) { | ||||
| 		throw new Error('[[error:invalid-uid]]'); // should be activitypub-specific | ||||
|   | ||||
		Reference in New Issue
	
	Block a user