Split types and typings
[oweals/peertube.git] / server / lib / job-queue / handlers / activitypub-follow.ts
index 94eeed4c0f2db13fdd328b75748ddd8693f2ce1d..7a4f85f8b5fd32e153223bf2d5588ce0522bc308 100644 (file)
@@ -10,15 +10,8 @@ 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'
 
 async function processActivityPubFollow (job: Bull.Job) {
   const payload = job.data as ActivitypubFollowPayload
@@ -36,7 +29,7 @@ async function processActivityPubFollow (job: Bull.Job) {
   }
 
   if (payload.assertIsChannel && !targetActor.VideoChannel) {
-    logger.warn('Do not follow %s@%s because it is not a channel.', name, host)
+    logger.warn('Do not follow %s@%s because it is not a channel.', payload.name, host)
     return
   }