diff options
Diffstat (limited to 'server/lib/job-queue')
-rw-r--r-- | server/lib/job-queue/handlers/activitypub-follow.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/server/lib/job-queue/handlers/activitypub-follow.ts b/server/lib/job-queue/handlers/activitypub-follow.ts index 4a7cda0a2..94eeed4c0 100644 --- a/server/lib/job-queue/handlers/activitypub-follow.ts +++ b/server/lib/job-queue/handlers/activitypub-follow.ts | |||
@@ -17,6 +17,7 @@ export type ActivitypubFollowPayload = { | |||
17 | name: string | 17 | name: string |
18 | host: string | 18 | host: string |
19 | isAutoFollow?: boolean | 19 | isAutoFollow?: boolean |
20 | assertIsChannel?: boolean | ||
20 | } | 21 | } |
21 | 22 | ||
22 | async function processActivityPubFollow (job: Bull.Job) { | 23 | async function processActivityPubFollow (job: Bull.Job) { |
@@ -34,6 +35,11 @@ async function processActivityPubFollow (job: Bull.Job) { | |||
34 | targetActor = await getOrCreateActorAndServerAndModel(actorUrl, 'all') | 35 | targetActor = await getOrCreateActorAndServerAndModel(actorUrl, 'all') |
35 | } | 36 | } |
36 | 37 | ||
38 | if (payload.assertIsChannel && !targetActor.VideoChannel) { | ||
39 | logger.warn('Do not follow %s@%s because it is not a channel.', name, host) | ||
40 | return | ||
41 | } | ||
42 | |||
37 | const fromActor = await ActorModel.load(payload.followerActorId) | 43 | const fromActor = await ActorModel.load(payload.followerActorId) |
38 | 44 | ||
39 | return retryTransactionWrapper(follow, fromActor, targetActor, payload.isAutoFollow) | 45 | return retryTransactionWrapper(follow, fromActor, targetActor, payload.isAutoFollow) |