X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fvideo-comments.ts;h=c3fc6b4621926179d24621a38e8138ab1811051b;hb=b91bc1d1f3591c35ab4426f6ab594b4bd9f1ef62;hp=18f44d50ecbee4bfb1aaca7efd61809a1a20a3a9;hpb=3acc50844047a37698f0618fa235c138e386a053;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts index 18f44d50e..c3fc6b462 100644 --- a/server/lib/activitypub/video-comments.ts +++ b/server/lib/activitypub/video-comments.ts @@ -80,7 +80,8 @@ async function addVideoComment (videoInstance: VideoModel, commentUrl: string) { return { comment, created } } -async function resolveThread (url: string, comments: VideoCommentModel[] = []) { +type ResolveThreadResult = Promise<{ video: VideoModel, parents: VideoCommentModel[] }> +async function resolveThread (url: string, comments: VideoCommentModel[] = []): ResolveThreadResult { // Already have this comment? const commentFromDatabase = await VideoCommentModel.loadByUrlAndPopulateReplyAndVideo(url) if (commentFromDatabase) { @@ -161,7 +162,6 @@ async function resolveThread (url: string, comments: VideoCommentModel[] = []) { return resolveThread(body.inReplyTo, comments.concat([ comment ])) } - } export {