From 084a2cd0f6274afac0fbcd714e627273da1df25e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Feb 2020 16:34:46 +0100 Subject: Optimize context for CacheFile --- server/lib/activitypub/send/send-create.ts | 5 ++++- server/lib/activitypub/send/send-update.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'server/lib/activitypub') diff --git a/server/lib/activitypub/send/send-create.ts b/server/lib/activitypub/send/send-create.ts index 3585d704a..8bdcf6417 100644 --- a/server/lib/activitypub/send/send-create.ts +++ b/server/lib/activitypub/send/send-create.ts @@ -16,6 +16,7 @@ import { MVideoRedundancyFileVideo, MVideoRedundancyStreamingPlaylistVideo } from '../../../typings/models' +import { ContextType } from '@server/helpers/activitypub' 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' }) } @@ -135,6 +137,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) diff --git a/server/lib/activitypub/send/send-update.ts b/server/lib/activitypub/send/send-update.ts index cb500bd34..2b01ca5e7 100644 --- a/server/lib/activitypub/send/send-update.ts +++ b/server/lib/activitypub/send/send-update.ts @@ -84,7 +84,7 @@ async function sendUpdateCacheFile (byActor: MActorLight, redundancyModel: MVide return buildUpdateActivity(url, byActor, redundancyObject, audience) } - return sendVideoRelatedActivity(activityBuilder, { byActor, video }) + return sendVideoRelatedActivity(activityBuilder, { byActor, video, contextType: 'CacheFile' }) } async function sendUpdateVideoPlaylist (videoPlaylist: MVideoPlaylistFull, t: Transaction) { -- cgit v1.2.3