aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-14 12:11:06 +0100
committerChocobozzz <me@florianbigard.com>2019-01-14 12:11:06 +0100
commit699b059e2d6cdd09685a69261f2ca5cf63053a71 (patch)
treee9a94a91f6b4a902fc528a021ab5cfe38c2d4750 /server/lib/activitypub
parentb5487ff4a5c0bb2acaca79ee00df26a83886c889 (diff)
downloadPeerTube-699b059e2d6cdd09685a69261f2ca5cf63053a71.tar.gz
PeerTube-699b059e2d6cdd09685a69261f2ca5cf63053a71.tar.zst
PeerTube-699b059e2d6cdd09685a69261f2ca5cf63053a71.zip
Fix deleting not found remote actors
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r--server/lib/activitypub/actor.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index d728c81d1..edf38bc0a 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -211,7 +211,14 @@ async function refreshActorIfNeeded (
211 const actor = fetchedType === 'all' ? actorArg : await ActorModel.loadByUrlAndPopulateAccountAndChannel(actorArg.url) 211 const actor = fetchedType === 'all' ? actorArg : await ActorModel.loadByUrlAndPopulateAccountAndChannel(actorArg.url)
212 212
213 try { 213 try {
214 const actorUrl = await getUrlFromWebfinger(actor.preferredUsername + '@' + actor.getHost()) 214 let actorUrl: string
215 try {
216 actorUrl = await getUrlFromWebfinger(actor.preferredUsername + '@' + actor.getHost())
217 } catch (err) {
218 logger.warn('Cannot get actor URL from webfinger, keeping the old one.', err)
219 actorUrl = actor.url
220 }
221
215 const { result, statusCode } = await fetchRemoteActor(actorUrl) 222 const { result, statusCode } = await fetchRemoteActor(actorUrl)
216 223
217 if (statusCode === 404) { 224 if (statusCode === 404) {
@@ -429,5 +436,3 @@ async function saveVideoChannel (actor: ActorModel, result: FetchRemoteActorResu
429 436
430 return videoChannelCreated 437 return videoChannelCreated
431} 438}
432
433