refactor: store local follow backreferences for remote users (both followers and following), update actor pruning to take local follow counts into consideration, fixes #12701

This commit is contained in:
Julian Lam
2024-07-19 14:37:32 -04:00
parent a884681abf
commit 39f92eac16
5 changed files with 67 additions and 14 deletions

View File

@@ -181,7 +181,7 @@ async function assertRelation(post) {
*/
// Is followed by at least one local user
const numFollowers = await activitypub.actors.getLocalFollowersCount(post.uid);
const { followers } = await activitypub.actors.getLocalFollowCounts(post.uid);
// Local user is mentioned
const { tag } = post._activitypub;
@@ -201,7 +201,7 @@ async function assertRelation(post) {
uids = uids.filter(Boolean);
}
return numFollowers > 0 || uids.length;
return followers > 0 || uids.length;
}
Notes.updateLocalRecipients = async (id, { to, cc }) => {