mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	fix: update logic re: federating out topic moves
This commit is contained in:
		| @@ -373,8 +373,10 @@ Out.move.context = enabledCheck(async (uid, tid) => { | |||||||
| 	const { cid, oldCid } = await topics.getTopicFields(tid, ['cid', 'oldCid']); | 	const { cid, oldCid } = await topics.getTopicFields(tid, ['cid', 'oldCid']); | ||||||
|  |  | ||||||
| 	// This check may be revised if inter-community moderation becomes real. | 	// This check may be revised if inter-community moderation becomes real. | ||||||
| 	const isNotLocal = id => !utils.isNumber(id) || parseInt(id, 10) < 1; | 	const isLocal = id => utils.isNumber(id) && parseInt(id, 10) > 0; | ||||||
| 	if ([cid, oldCid].some(isNotLocal)) { | 	if (isLocal(oldCid) && !isLocal(cid)) { // moving to remote/uncategorized | ||||||
|  | 		return Out.remove.context(uid, tid); | ||||||
|  | 	} else if ((isLocal(cid) && !isLocal(oldCid)) || [cid, oldCid].every(!isLocal)) { // stealing or remote-to-remote | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user