]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/job-queue/handlers/activitypub-follow.ts
Import in private, and then set the chosen privacy
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / activitypub-follow.ts
index e467c5b1b12a1f0f7f1cf8cb469440e1a6445ce8..82c95be800292f2000db7afda50ad0715eb72288 100644 (file)
@@ -10,15 +10,9 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
 import { ActorModel } from '../../../models/activitypub/actor'
 import { Notifier } from '../../notifier'
 import { sequelizeTypescript } from '../../../initializers/database'
-import { MActor, MActorFollowActors, MActorFull } from '../../../typings/models'
-
-export type ActivitypubFollowPayload = {
-  followerActorId: number
-  name: string
-  host: string
-  isAutoFollow?: boolean
-  assertIsChannel?: boolean
-}
+import { MActor, MActorFollowActors, MActorFull } from '../../../types/models'
+import { ActivitypubFollowPayload } from '@shared/models'
+import { getLocalActorFollowActivityPubUrl } from '@server/lib/activitypub/url'
 
 async function processActivityPubFollow (job: Bull.Job) {
   const payload = job.data as ActivitypubFollowPayload
@@ -68,6 +62,7 @@ async function follow (fromActor: MActor, targetActor: MActorFull, isAutoFollow
       },
       defaults: {
         state,
+        url: getLocalActorFollowActivityPubUrl(fromActor, targetActor),
         actorId: fromActor.id,
         targetActorId: targetActor.id
       },