aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/actors
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-03 18:10:56 +0200
committerChocobozzz <me@florianbigard.com>2021-06-03 18:10:56 +0200
commit868fce62f86812759ccedccf7634236ac3701d9a (patch)
tree79074e065d885bf8903920bf38af06cb209919b6 /server/lib/activitypub/actors
parent10363c74c1d869f0e0c7bc4d0367b1f34d1bb6a4 (diff)
downloadPeerTube-868fce62f86812759ccedccf7634236ac3701d9a.tar.gz
PeerTube-868fce62f86812759ccedccf7634236ac3701d9a.tar.zst
PeerTube-868fce62f86812759ccedccf7634236ac3701d9a.zip
fetch -> load
avoid confusion with AP fetch functions
Diffstat (limited to 'server/lib/activitypub/actors')
-rw-r--r--server/lib/activitypub/actors/get.ts8
-rw-r--r--server/lib/activitypub/actors/refresh.ts4
2 files changed, 6 insertions, 6 deletions
diff --git a/server/lib/activitypub/actors/get.ts b/server/lib/activitypub/actors/get.ts
index e7e87a967..c7b49d6e4 100644
--- a/server/lib/activitypub/actors/get.ts
+++ b/server/lib/activitypub/actors/get.ts
@@ -3,7 +3,7 @@ import { checkUrlsSameHost, getAPId } from '@server/helpers/activitypub'
3import { retryTransactionWrapper } from '@server/helpers/database-utils' 3import { retryTransactionWrapper } from '@server/helpers/database-utils'
4import { logger } from '@server/helpers/logger' 4import { logger } from '@server/helpers/logger'
5import { JobQueue } from '@server/lib/job-queue' 5import { JobQueue } from '@server/lib/job-queue'
6import { ActorFetchByUrlType, fetchActorByUrl } from '@server/lib/model-loaders' 6import { ActorLoadByUrlType, loadActorByUrl } from '@server/lib/model-loaders'
7import { MActor, MActorAccountChannelId, MActorAccountChannelIdActor, MActorAccountId, MActorFullActor } from '@server/types/models' 7import { MActor, MActorAccountChannelId, MActorAccountChannelIdActor, MActorAccountId, MActorFullActor } from '@server/types/models'
8import { ActivityPubActor } from '@shared/models' 8import { ActivityPubActor } from '@shared/models'
9import { refreshActorIfNeeded } from './refresh' 9import { refreshActorIfNeeded } from './refresh'
@@ -25,7 +25,7 @@ function getOrCreateAPActor (
25 25
26async function getOrCreateAPActor ( 26async function getOrCreateAPActor (
27 activityActor: string | ActivityPubActor, 27 activityActor: string | ActivityPubActor,
28 fetchType: ActorFetchByUrlType = 'association-ids', 28 fetchType: ActorLoadByUrlType = 'association-ids',
29 recurseIfNeeded = true, 29 recurseIfNeeded = true,
30 updateCollections = false 30 updateCollections = false
31): Promise<MActorFullActor | MActorAccountChannelId> { 31): Promise<MActorFullActor | MActorAccountChannelId> {
@@ -73,8 +73,8 @@ export {
73 73
74// --------------------------------------------------------------------------- 74// ---------------------------------------------------------------------------
75 75
76async function loadActorFromDB (actorUrl: string, fetchType: ActorFetchByUrlType) { 76async function loadActorFromDB (actorUrl: string, fetchType: ActorLoadByUrlType) {
77 let actor = await fetchActorByUrl(actorUrl, fetchType) 77 let actor = await loadActorByUrl(actorUrl, fetchType)
78 78
79 // Orphan actor (not associated to an account of channel) so recreate it 79 // Orphan actor (not associated to an account of channel) so recreate it
80 if (actor && (!actor.Account && !actor.VideoChannel)) { 80 if (actor && (!actor.Account && !actor.VideoChannel)) {
diff --git a/server/lib/activitypub/actors/refresh.ts b/server/lib/activitypub/actors/refresh.ts
index 9f2289bfa..9758649a5 100644
--- a/server/lib/activitypub/actors/refresh.ts
+++ b/server/lib/activitypub/actors/refresh.ts
@@ -1,6 +1,6 @@
1import { logger } from '@server/helpers/logger' 1import { logger } from '@server/helpers/logger'
2import { PeerTubeRequestError } from '@server/helpers/requests' 2import { PeerTubeRequestError } from '@server/helpers/requests'
3import { ActorFetchByUrlType } from '@server/lib/model-loaders' 3import { ActorLoadByUrlType } from '@server/lib/model-loaders'
4import { ActorModel } from '@server/models/actor/actor' 4import { ActorModel } from '@server/models/actor/actor'
5import { MActorAccountChannelId, MActorFull } from '@server/types/models' 5import { MActorAccountChannelId, MActorFull } from '@server/types/models'
6import { HttpStatusCode } from '@shared/core-utils' 6import { HttpStatusCode } from '@shared/core-utils'
@@ -10,7 +10,7 @@ import { getUrlFromWebfinger } from './webfinger'
10 10
11async function refreshActorIfNeeded <T extends MActorFull | MActorAccountChannelId> ( 11async function refreshActorIfNeeded <T extends MActorFull | MActorAccountChannelId> (
12 actorArg: T, 12 actorArg: T,
13 fetchedType: ActorFetchByUrlType 13 fetchedType: ActorLoadByUrlType
14): Promise<{ actor: T | MActorFull, refreshed: boolean }> { 14): Promise<{ actor: T | MActorFull, refreshed: boolean }> {
15 if (!actorArg.isOutdated()) return { actor: actorArg, refreshed: false } 15 if (!actorArg.isOutdated()) return { actor: actorArg, refreshed: false }
16 16