]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-accept.ts
Add context on activitypub responses
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-accept.ts
index b9d906ec94c7afe65e9747509ae672e32e444753..7db2f8ff03c33a32468852d8d3e731497725fb28 100644 (file)
@@ -23,7 +23,9 @@ async function processAccept (actor: ActorModel, targetActor: ActorModel) {
   const follow = await ActorFollowModel.loadByActorAndTarget(actor.id, targetActor.id)
   if (!follow) throw new Error('Cannot find associated follow.')
 
-  follow.set('state', 'accepted')
-  await follow.save()
-  await addFetchOutboxJob(targetActor, undefined)
+  if (follow.state !== 'accepted') {
+    follow.set('state', 'accepted')
+    await follow.save()
+    await addFetchOutboxJob(targetActor)
+  }
 }