mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	limit federation of reactions on direct notes (#8448)
This commit is contained in:
		
							parent
							
								
									c7969ef418
								
							
						
					
					
						commit
						a6f6ddc34e
					
				
					 1 changed files with 10 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -124,7 +124,16 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note,
 | 
			
		|||
			const reactee = await Users.findOneBy({ id: note.userId });
 | 
			
		||||
			dm.addDirectRecipe(reactee as IRemoteUser);
 | 
			
		||||
		}
 | 
			
		||||
		dm.addFollowersRecipe();
 | 
			
		||||
 | 
			
		||||
		if (['public', 'home', 'followers'].includes(note.visibility)) {
 | 
			
		||||
			dm.addFollowersRecipe();
 | 
			
		||||
		} else if (note.visibility === 'specified') {
 | 
			
		||||
			const visibleUsers = await Promise.all(note.visibleUserIds.map(id => Users.findOneBy({ id })));
 | 
			
		||||
			for (const u of visibleUsers.filter(u => u && Users.isRemoteUser(u))) {
 | 
			
		||||
				dm.addDirectRecipe(u as IRemoteUser);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		dm.execute();
 | 
			
		||||
	}
 | 
			
		||||
	//#endregion
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue