diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-16 10:01:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-16 10:01:31 +0200 |
commit | fd6584844b070cfc283902aba26f2853473e83d1 (patch) | |
tree | ab0c522838736a92c27ed3514c0fa91942c5e9bf /server/lib | |
parent | 82d19a2249bbc8648f64bebd87a8c23013ecfe1a (diff) | |
download | PeerTube-fd6584844b070cfc283902aba26f2853473e83d1.tar.gz PeerTube-fd6584844b070cfc283902aba26f2853473e83d1.tar.zst PeerTube-fd6584844b070cfc283902aba26f2853473e83d1.zip |
Resolve object id from actors too
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/actors/get.ts | 3 | ||||
-rw-r--r-- | server/lib/activitypub/videos/get.ts | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/server/lib/activitypub/actors/get.ts b/server/lib/activitypub/actors/get.ts index 501ff74e3..d7cf2b678 100644 --- a/server/lib/activitypub/actors/get.ts +++ b/server/lib/activitypub/actors/get.ts | |||
@@ -40,6 +40,9 @@ async function getOrCreateAPActor ( | |||
40 | const { actorObject } = await fetchRemoteActor(actorUrl) | 40 | const { actorObject } = await fetchRemoteActor(actorUrl) |
41 | if (actorObject === undefined) throw new Error('Cannot fetch remote actor ' + actorUrl) | 41 | if (actorObject === undefined) throw new Error('Cannot fetch remote actor ' + actorUrl) |
42 | 42 | ||
43 | // actorUrl is just an alias/rediraction, so process object id instead | ||
44 | if (actorObject.id !== actorUrl) return getOrCreateAPActor(actorObject, 'all', recurseIfNeeded, updateCollections) | ||
45 | |||
43 | // Create the attributed to actor | 46 | // Create the attributed to actor |
44 | // In PeerTube a video channel is owned by an account | 47 | // In PeerTube a video channel is owned by an account |
45 | let ownerActor: MActorFullActor | 48 | let ownerActor: MActorFullActor |
diff --git a/server/lib/activitypub/videos/get.ts b/server/lib/activitypub/videos/get.ts index f0982bd98..7bb14adc4 100644 --- a/server/lib/activitypub/videos/get.ts +++ b/server/lib/activitypub/videos/get.ts | |||
@@ -61,6 +61,7 @@ async function getOrCreateAPVideo ( | |||
61 | const { videoObject } = await fetchRemoteVideo(videoUrl) | 61 | const { videoObject } = await fetchRemoteVideo(videoUrl) |
62 | if (!videoObject) throw new Error('Cannot fetch remote video with url: ' + videoUrl) | 62 | if (!videoObject) throw new Error('Cannot fetch remote video with url: ' + videoUrl) |
63 | 63 | ||
64 | // videoUrl is just an alias/rediraction, so process object id instead | ||
64 | if (videoObject.id !== videoUrl) return getOrCreateAPVideo({ ...options, fetchType: 'all', videoObject }) | 65 | if (videoObject.id !== videoUrl) return getOrCreateAPVideo({ ...options, fetchType: 'all', videoObject }) |
65 | 66 | ||
66 | try { | 67 | try { |