]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-accept.ts
Remove comment federation by video owner
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-accept.ts
index 89bda9c32a531c4d49472702e59801ccae403582..72bb1975e8ac502b831e1a293dc401cb0f86e063 100644 (file)
@@ -2,8 +2,10 @@ import { ActivityAccept } from '../../../../shared/models/activitypub'
 import { ActorModel } from '../../../models/activitypub/actor'
 import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
 import { addFetchOutboxJob } from '../actor'
+import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
 
-async function processAcceptActivity (activity: ActivityAccept, targetActor: ActorModel, inboxActor?: ActorModel) {
+async function processAcceptActivity (options: APProcessorOptions<ActivityAccept>) {
+  const { byActor: targetActor, inboxActor } = options
   if (inboxActor === undefined) throw new Error('Need to accept on explicit inbox.')
 
   return processAccept(inboxActor, targetActor)
@@ -24,6 +26,7 @@ async function processAccept (actor: ActorModel, targetActor: ActorModel) {
   if (follow.state !== 'accepted') {
     follow.set('state', 'accepted')
     await follow.save()
+
     await addFetchOutboxJob(targetActor)
   }
 }