diff options
author | Chocobozzz <me@florianbigard.com> | 2018-07-31 11:15:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-07-31 11:15:59 +0200 |
commit | 6104adc3e9d325e003ca1048e8ef35f6a451d0c3 (patch) | |
tree | dd8daa7adc2d11d848512af5708207232885cb0d /server/lib/job-queue/handlers | |
parent | 25e4d6ee97e9b7a80338cb9c3db5169bf633e32f (diff) | |
download | PeerTube-6104adc3e9d325e003ca1048e8ef35f6a451d0c3.tar.gz PeerTube-6104adc3e9d325e003ca1048e8ef35f6a451d0c3.tar.zst PeerTube-6104adc3e9d325e003ca1048e8ef35f6a451d0c3.zip |
Don't send follow request if the follow is already accepted
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r-- | server/lib/job-queue/handlers/activitypub-follow.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/job-queue/handlers/activitypub-follow.ts b/server/lib/job-queue/handlers/activitypub-follow.ts index 2c1b4f49d..393c6936c 100644 --- a/server/lib/job-queue/handlers/activitypub-follow.ts +++ b/server/lib/job-queue/handlers/activitypub-follow.ts | |||
@@ -58,7 +58,7 @@ function follow (fromActor: ActorModel, targetActor: ActorModel) { | |||
58 | actorFollow.ActorFollowing = targetActor | 58 | actorFollow.ActorFollowing = targetActor |
59 | actorFollow.ActorFollower = fromActor | 59 | actorFollow.ActorFollower = fromActor |
60 | 60 | ||
61 | // Send a notification to remote server | 61 | // Send a notification to remote server if our follow is not already accepted |
62 | await sendFollow(actorFollow) | 62 | if (actorFollow.state !== 'accepted') await sendFollow(actorFollow) |
63 | }) | 63 | }) |
64 | } | 64 | } |