Skip to content
Snippets Groups Projects
Unverified Commit a6f6ddc3 authored by Johann150's avatar Johann150 Committed by GitHub
Browse files

limit federation of reactions on direct notes (#8448)

parent c7969ef4
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment