diff options
Diffstat (limited to 'server/lib/activitypub/follow.ts')
-rw-r--r-- | server/lib/activitypub/follow.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/server/lib/activitypub/follow.ts b/server/lib/activitypub/follow.ts index 351499bd1..c1bd667e0 100644 --- a/server/lib/activitypub/follow.ts +++ b/server/lib/activitypub/follow.ts | |||
@@ -1,12 +1,13 @@ | |||
1 | import { MActorFollowActors } from '../../types/models' | 1 | import { Transaction } from 'sequelize' |
2 | import { getServerActor } from '@server/models/application/application' | ||
3 | import { logger } from '../../helpers/logger' | ||
2 | import { CONFIG } from '../../initializers/config' | 4 | import { CONFIG } from '../../initializers/config' |
3 | import { SERVER_ACTOR_NAME } from '../../initializers/constants' | 5 | import { SERVER_ACTOR_NAME } from '../../initializers/constants' |
4 | import { JobQueue } from '../job-queue' | ||
5 | import { logger } from '../../helpers/logger' | ||
6 | import { ServerModel } from '../../models/server/server' | 6 | import { ServerModel } from '../../models/server/server' |
7 | import { getServerActor } from '@server/models/application/application' | 7 | import { MActorFollowActors } from '../../types/models' |
8 | import { JobQueue } from '../job-queue' | ||
8 | 9 | ||
9 | async function autoFollowBackIfNeeded (actorFollow: MActorFollowActors) { | 10 | async function autoFollowBackIfNeeded (actorFollow: MActorFollowActors, transaction?: Transaction) { |
10 | if (!CONFIG.FOLLOWINGS.INSTANCE.AUTO_FOLLOW_BACK.ENABLED) return | 11 | if (!CONFIG.FOLLOWINGS.INSTANCE.AUTO_FOLLOW_BACK.ENABLED) return |
11 | 12 | ||
12 | const follower = actorFollow.ActorFollower | 13 | const follower = actorFollow.ActorFollower |
@@ -16,7 +17,7 @@ async function autoFollowBackIfNeeded (actorFollow: MActorFollowActors) { | |||
16 | 17 | ||
17 | const me = await getServerActor() | 18 | const me = await getServerActor() |
18 | 19 | ||
19 | const server = await ServerModel.load(follower.serverId) | 20 | const server = await ServerModel.load(follower.serverId, transaction) |
20 | const host = server.host | 21 | const host = server.host |
21 | 22 | ||
22 | const payload = { | 23 | const payload = { |