aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-10 15:26:33 +0100
committerChocobozzz <me@florianbigard.com>2020-11-10 15:26:33 +0100
commit10c8b0b743ae5aa7e89c7fe5745821278b71d52c (patch)
tree64980fa02670a965d0f35b7b654bae4533f3e9dc
parenta25507f6c4dd6077d0ea33d884dcb145f3b359e9 (diff)
downloadPeerTube-10c8b0b743ae5aa7e89c7fe5745821278b71d52c.tar.gz
PeerTube-10c8b0b743ae5aa7e89c7fe5745821278b71d52c.tar.zst
PeerTube-10c8b0b743ae5aa7e89c7fe5745821278b71d52c.zip
Fix comments federation
-rw-r--r--server/lib/activitypub/video-comments.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts
index 776a295c0..902d877c4 100644
--- a/server/lib/activitypub/video-comments.ts
+++ b/server/lib/activitypub/video-comments.ts
@@ -28,14 +28,18 @@ async function resolveThread (params: ResolveThreadParams): ResolveThreadResult
28 if (params.commentCreated === undefined) params.commentCreated = false 28 if (params.commentCreated === undefined) params.commentCreated = false
29 if (params.comments === undefined) params.comments = [] 29 if (params.comments === undefined) params.comments = []
30 30
31 // Already have this comment? 31 // If it is not a video, or if we don't know if it's a video
32 if (isVideo === false) { 32 if (isVideo === false || isVideo === undefined) {
33 const result = await resolveCommentFromDB(params) 33 const result = await resolveCommentFromDB(params)
34 if (result) return result 34 if (result) return result
35 } 35 }
36 36
37 try { 37 try {
38 if (isVideo === true) return tryResolveThreadFromVideo(params) 38 // If it is a video, or if we don't know if it's a video
39 if (isVideo === true || isVideo === undefined) {
40 // Keep await so we catch the exception
41 return await tryResolveThreadFromVideo(params)
42 }
39 } catch (err) { 43 } catch (err) {
40 logger.debug('Cannot get or create account and video and channel for reply %s, fetch comment', url, { err }) 44 logger.debug('Cannot get or create account and video and channel for reply %s, fetch comment', url, { err })
41 } 45 }