feat: save actor follower URL backreference and sorted set backreference

This commit is contained in:
Julian Lam
2024-02-12 14:32:55 -05:00
parent 401b4c5fa6
commit da085b0ece
2 changed files with 19 additions and 7 deletions

View File

@@ -204,6 +204,7 @@ inbox.accept = async (req) => {
if (type === 'Follow') {
const now = Date.now();
await db.sortedSetAdd(`followingRemote:${uid}`, now, actor);
await db.sortedSetAdd(`followersRemote:${actor}`, now, uid); // for followers backreference
const followingRemoteCount = await db.sortedSetCard(`followingRemote:${uid}`);
await user.setUserField(uid, 'followingRemoteCount', followingRemoteCount);
}