-import { Transaction } from 'sequelize'
-import { ActivityFollow } from '../../../../shared/models/activitypub/activity'
-import { AccountInstance } from '../../../models'
-import { AccountFollowInstance } from '../../../models/account/account-follow-interface'
-import { getAccountFollowActivityPubUrl } from '../url'
-import { unicastTo } from './misc'
-
-function sendFollow (accountFollow: AccountFollowInstance, t: Transaction) {
- const me = accountFollow.AccountFollower
- const following = accountFollow.AccountFollowing
-
- const url = getAccountFollowActivityPubUrl(accountFollow)
+import { ActivityFollow } from '../../../../shared/models/activitypub'
+import { ActorModel } from '../../../models/activitypub/actor'
+import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
+import { getActorFollowActivityPubUrl } from '../url'
+import { unicastTo } from './utils'
+import { logger } from '../../../helpers/logger'
+
+function sendFollow (actorFollow: ActorFollowModel) {
+ const me = actorFollow.ActorFollower
+ const following = actorFollow.ActorFollowing
+
+ // Same server as ours
+ if (!following.serverId) return
+
+ logger.info('Creating job to send follow request to %s.', following.url)
+
+ const url = getActorFollowActivityPubUrl(actorFollow)