mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	fix: Update(Note) federation should only apply to local content
This commit is contained in:
		| @@ -17,6 +17,7 @@ const meta = require('../meta'); | |||||||
| const privileges = require('../privileges'); | const privileges = require('../privileges'); | ||||||
| const activitypub = require('../activitypub'); | const activitypub = require('../activitypub'); | ||||||
| const posts = require('../posts'); | const posts = require('../posts'); | ||||||
|  | const utils = require('../utils'); | ||||||
|  |  | ||||||
| const activitypubApi = module.exports; | const activitypubApi = module.exports; | ||||||
|  |  | ||||||
| @@ -183,6 +184,11 @@ activitypubApi.update.profile = enabledCheck(async (caller, { uid }) => { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| activitypubApi.update.note = enabledCheck(async (caller, { post }) => { | activitypubApi.update.note = enabledCheck(async (caller, { post }) => { | ||||||
|  | 	// Only applies to local posts | ||||||
|  | 	if (!utils.isNumber(post.pid)) { | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	const object = await activitypub.mocks.note(post); | 	const object = await activitypub.mocks.note(post); | ||||||
| 	const { targets } = await buildRecipients(object, { pid: post.pid, uid: post.user.uid }); | 	const { targets } = await buildRecipients(object, { pid: post.pid, uid: post.user.uid }); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user