From 136d7efde798d3dc0ec0dd18aac674365f7d162e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 3 Jun 2021 16:02:29 +0200 Subject: Refactor AP actors --- server/lib/job-queue/handlers/activitypub-follow.ts | 4 ++-- server/lib/job-queue/handlers/activitypub-refresher.ts | 2 +- server/lib/job-queue/handlers/actor-keys.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server/lib/job-queue') diff --git a/server/lib/job-queue/handlers/activitypub-follow.ts b/server/lib/job-queue/handlers/activitypub-follow.ts index ec8df8969..76b6fcaae 100644 --- a/server/lib/job-queue/handlers/activitypub-follow.ts +++ b/server/lib/job-queue/handlers/activitypub-follow.ts @@ -10,7 +10,7 @@ import { sequelizeTypescript } from '../../../initializers/database' import { ActorModel } from '../../../models/actor/actor' import { ActorFollowModel } from '../../../models/actor/actor-follow' import { MActor, MActorFollowActors, MActorFull } from '../../../types/models' -import { getOrCreateActorAndServerAndModel } from '../../activitypub/actor' +import { getOrCreateAPActor } from '../../activitypub/actors' import { sendFollow } from '../../activitypub/send' import { Notifier } from '../../notifier' @@ -26,7 +26,7 @@ async function processActivityPubFollow (job: Bull.Job) { } else { const sanitizedHost = sanitizeHost(host, REMOTE_SCHEME.HTTP) const actorUrl = await loadActorUrlOrGetFromWebfinger(payload.name + '@' + sanitizedHost) - targetActor = await getOrCreateActorAndServerAndModel(actorUrl, 'all') + targetActor = await getOrCreateAPActor(actorUrl, 'all') } if (payload.assertIsChannel && !targetActor.VideoChannel) { diff --git a/server/lib/job-queue/handlers/activitypub-refresher.ts b/server/lib/job-queue/handlers/activitypub-refresher.ts index 10e6895da..29483f310 100644 --- a/server/lib/job-queue/handlers/activitypub-refresher.ts +++ b/server/lib/job-queue/handlers/activitypub-refresher.ts @@ -6,7 +6,7 @@ import { logger } from '../../../helpers/logger' import { fetchVideoByUrl } from '../../../helpers/video' import { ActorModel } from '../../../models/actor/actor' import { VideoPlaylistModel } from '../../../models/video/video-playlist' -import { refreshActorIfNeeded } from '../../activitypub/actor' +import { refreshActorIfNeeded } from '../../activitypub/actors' async function refreshAPObject (job: Bull.Job) { const payload = job.data as RefreshPayload diff --git a/server/lib/job-queue/handlers/actor-keys.ts b/server/lib/job-queue/handlers/actor-keys.ts index 3eef565d0..60ac61afd 100644 --- a/server/lib/job-queue/handlers/actor-keys.ts +++ b/server/lib/job-queue/handlers/actor-keys.ts @@ -1,5 +1,5 @@ import * as Bull from 'bull' -import { generateAndSaveActorKeys } from '@server/lib/activitypub/actor' +import { generateAndSaveActorKeys } from '@server/lib/activitypub/actors' import { ActorModel } from '@server/models/actor/actor' import { ActorKeysPayload } from '@shared/models' import { logger } from '../../../helpers/logger' -- cgit v1.2.3