X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fsend%2Fsend-create.ts;h=8bdcf6417cf64f12e42d17f96b6eea21bb179a0d;hb=5db4545cd2af2298ef6514dde2c36edc98ef5e33;hp=edbc14a73e73fb66466bb5405ab0ad47d9879bad;hpb=47581df0737ebcc058a5863143c752f9112a4424;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.ts index edbc14a73..8bdcf6417 100644 --- a/server/lib/activitypub/send/send-create.ts +++ b/server/lib/activitypub/send/send-create.ts @@ -16,9 +16,10 @@ import { MVideoRedundancyFileVideo, MVideoRedundancyStreamingPlaylistVideo } from '../../../typings/models' +import { ContextType } from '@server/helpers/activitypub' async function sendCreateVideo (video: MVideoAP, t: Transaction) { - if (video.privacy === VideoPrivacy.PRIVATE) return undefined + if (!video.hasPrivacyForFederation()) return undefined logger.info('Creating job to send video creation of %s.', video.url) @@ -42,7 +43,8 @@ async function sendCreateCacheFile ( byActor, video, url: fileRedundancy.url, - object: fileRedundancy.toActivityPubObject() + object: fileRedundancy.toActivityPubObject(), + contextType: 'CacheFile' }) } @@ -130,11 +132,12 @@ export { // --------------------------------------------------------------------------- async function sendVideoRelatedCreateActivity (options: { - byActor: MActorLight, - video: MVideoAccountLight, - url: string, - object: any, + byActor: MActorLight + video: MVideoAccountLight + url: string + object: any transaction?: Transaction + contextType?: ContextType }) { const activityBuilder = (audience: ActivityAudience) => { return buildCreateActivity(options.url, options.byActor, options.object, audience)