X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fsend%2Fsend-create.ts;h=9fb2182249dd09127d3a67795b70a03bf0cf5299;hb=2291a412d25bd139398ca9e7a5131d0c1e4ffd7d;hp=3585d704aeea8909e097731f1bd830bda0f70701;hpb=7cd1b12c19d0589d1d692ed0571ca0800f028aea;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.ts index 3585d704a..9fb218224 100644 --- a/server/lib/activitypub/send/send-create.ts +++ b/server/lib/activitypub/send/send-create.ts @@ -6,7 +6,6 @@ import { broadcastToActors, broadcastToFollowers, sendVideoRelatedActivity, unic import { audiencify, getActorsInvolvedInVideo, getAudience, getAudienceFromFollowersOf, getVideoCommentAudience } from '../audience' import { logger } from '../../../helpers/logger' import { VideoPlaylistPrivacy } from '../../../../shared/models/videos/playlist/video-playlist-privacy.model' -import { getServerActor } from '../../../helpers/utils' import { MActorLight, MCommentOwnerVideo, @@ -15,7 +14,9 @@ import { MVideoPlaylistFull, MVideoRedundancyFileVideo, MVideoRedundancyStreamingPlaylistVideo -} from '../../../typings/models' +} from '../../../types/models' +import { getServerActor } from '@server/models/application/application' +import { ContextType } from '@shared/models/activitypub/context' async function sendCreateVideo (video: MVideoAP, t: Transaction) { if (!video.hasPrivacyForFederation()) return undefined @@ -42,7 +43,8 @@ async function sendCreateCacheFile ( byActor, video, url: fileRedundancy.url, - object: fileRedundancy.toActivityPubObject() + object: fileRedundancy.toActivityPubObject(), + contextType: 'CacheFile' }) } @@ -78,7 +80,8 @@ async function sendCreateVideoComment (comment: MCommentOwnerVideo, t: Transacti // Add the actor that commented too actorsInvolvedInComment.push(byActor) - const parentsCommentActors = threadParentComments.map(c => c.Account.Actor) + const parentsCommentActors = threadParentComments.filter(c => !c.isDeleted()) + .map(c => c.Account.Actor) let audience: ActivityAudience if (isOrigin) { @@ -135,6 +138,7 @@ async function sendVideoRelatedCreateActivity (options: { url: string object: any transaction?: Transaction + contextType?: ContextType }) { const activityBuilder = (audience: ActivityAudience) => { return buildCreateActivity(options.url, options.byActor, options.object, audience)