mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 10:16:12 +01:00
fix: accept and undo logic saving improper id into database, updated follow logic so remote follow is not added to collection until an accept is received
This commit is contained in:
@@ -26,12 +26,6 @@ activitypubApi.follow = async (caller, { actorId } = {}) => {
|
||||
type: 'Follow',
|
||||
object: object.id,
|
||||
});
|
||||
|
||||
const now = Date.now();
|
||||
await Promise.all([
|
||||
db.sortedSetAdd(`followingRemote:${caller.uid}`, now, actorId),
|
||||
db.incrObjectField(`user:${caller.uid}`, 'followingRemoteCount'),
|
||||
]);
|
||||
};
|
||||
|
||||
activitypubApi.unfollow = async (caller, { actorId }) => {
|
||||
@@ -51,7 +45,7 @@ activitypubApi.unfollow = async (caller, { actorId }) => {
|
||||
});
|
||||
|
||||
await Promise.all([
|
||||
db.sortedSetRemove(`followingRemote:${caller.uid}`, actorId),
|
||||
db.sortedSetRemove(`followingRemote:${caller.uid}`, object.id),
|
||||
db.decrObjectField(`user:${caller.uid}`, 'followingRemoteCount'),
|
||||
]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user