X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fvideo-comments.ts;h=911c7cd3020b5f334215bd4950095273d9d0d547;hb=c5cadb2859050449596199090231d6e38bc4a571;hp=6b7f9504fde70c3a77d6abe614c23edb07953f03;hpb=cf21b2cbef61929177b9c09b5e017c3b7eb8535d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts index 6b7f9504f..911c7cd30 100644 --- a/server/lib/activitypub/video-comments.ts +++ b/server/lib/activitypub/video-comments.ts @@ -1,5 +1,4 @@ -import * as Bluebird from 'bluebird' -import { checkUrlsSameHost } from '../../helpers/activitypub' +import { map } from 'bluebird' import { sanitizeAndCheckVideoCommentObject } from '../../helpers/custom-validators/activitypub/video-comments' import { logger } from '../../helpers/logger' import { doJSONRequest } from '../../helpers/requests' @@ -7,6 +6,7 @@ import { ACTIVITY_PUB, CRAWL_REQUEST_CONCURRENCY } from '../../initializers/cons import { VideoCommentModel } from '../../models/video/video-comment' import { MCommentOwner, MCommentOwnerVideo, MVideoAccountLightBlacklistAllFiles } from '../../types/models/video' import { getOrCreateAPActor } from './actors' +import { checkUrlsSameHost } from './url' import { getOrCreateAPVideo } from './videos' type ResolveThreadParams = { @@ -18,7 +18,7 @@ type ResolveThreadParams = { type ResolveThreadResult = Promise<{ video: MVideoAccountLightBlacklistAllFiles, comment: MCommentOwnerVideo, commentCreated: boolean }> async function addVideoComments (commentUrls: string[]) { - return Bluebird.map(commentUrls, async commentUrl => { + return map(commentUrls, async commentUrl => { try { await resolveThread({ url: commentUrl, isVideo: false }) } catch (err) { @@ -87,7 +87,7 @@ async function tryToResolveThreadFromVideo (params: ResolveThreadParams) { // Maybe it's a reply to a video? // If yes, it's done: we resolved all the thread - const syncParam = { likes: true, dislikes: true, shares: true, comments: false, thumbnail: true, refreshVideo: false } + const syncParam = { rates: true, shares: true, comments: false, thumbnail: true, refreshVideo: false } const { video } = await getOrCreateAPVideo({ videoObject: url, syncParam }) if (video.isOwned() && !video.hasPrivacyForFederation()) {