diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-26 14:46:15 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-27 13:52:13 +0200 |
commit | 927fa4b11f692174d6296aa096d7a74bacdeea8b (patch) | |
tree | 20866dda219bbb5504d5645a980565fbbc25398a /server/lib/activitypub/process/process-follow.ts | |
parent | 0f58b11f5cace6e57cab5b4a18380eb297b43fe4 (diff) | |
download | PeerTube-927fa4b11f692174d6296aa096d7a74bacdeea8b.tar.gz PeerTube-927fa4b11f692174d6296aa096d7a74bacdeea8b.tar.zst PeerTube-927fa4b11f692174d6296aa096d7a74bacdeea8b.zip |
Add rejected state to follows
Prevent reprocessing already rejected follows
Diffstat (limited to 'server/lib/activitypub/process/process-follow.ts')
-rw-r--r-- | server/lib/activitypub/process/process-follow.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/lib/activitypub/process/process-follow.ts b/server/lib/activitypub/process/process-follow.ts index 93df7e191..a1958f464 100644 --- a/server/lib/activitypub/process/process-follow.ts +++ b/server/lib/activitypub/process/process-follow.ts | |||
@@ -58,6 +58,11 @@ async function processFollow (byActor: MActorSignature, activityId: string, targ | |||
58 | transaction: t | 58 | transaction: t |
59 | }) | 59 | }) |
60 | 60 | ||
61 | // Already rejected | ||
62 | if (actorFollow.state === 'rejected') { | ||
63 | return { actorFollow: undefined as MActorFollowActors } | ||
64 | } | ||
65 | |||
61 | // Set the follow as accepted if the remote actor follows a channel or account | 66 | // Set the follow as accepted if the remote actor follows a channel or account |
62 | // Or if the instance automatically accepts followers | 67 | // Or if the instance automatically accepts followers |
63 | if (actorFollow.state !== 'accepted' && (isFollowingInstance === false || CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false)) { | 68 | if (actorFollow.state !== 'accepted' && (isFollowingInstance === false || CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false)) { |