diff options
Diffstat (limited to 'server/lib/activitypub/send/send-update.ts')
-rw-r--r-- | server/lib/activitypub/send/send-update.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/server/lib/activitypub/send/send-update.ts b/server/lib/activitypub/send/send-update.ts index 17d4f185c..6f1d80898 100644 --- a/server/lib/activitypub/send/send-update.ts +++ b/server/lib/activitypub/send/send-update.ts | |||
@@ -10,13 +10,19 @@ import { getUpdateActivityPubUrl } from '../url' | |||
10 | import { broadcastToFollowers } from './utils' | 10 | import { broadcastToFollowers } from './utils' |
11 | import { audiencify, getAudience } from '../audience' | 11 | import { audiencify, getAudience } from '../audience' |
12 | import { logger } from '../../../helpers/logger' | 12 | import { logger } from '../../../helpers/logger' |
13 | import { videoFeedsValidator } from '../../../middlewares/validators' | ||
14 | import { VideoCaptionModel } from '../../../models/video/video-caption' | ||
13 | 15 | ||
14 | async function sendUpdateVideo (video: VideoModel, t: Transaction) { | 16 | async function sendUpdateVideo (video: VideoModel, t: Transaction, overrodeByActor?: ActorModel) { |
15 | logger.info('Creating job to update video %s.', video.url) | 17 | logger.info('Creating job to update video %s.', video.url) |
16 | 18 | ||
17 | const byActor = video.VideoChannel.Account.Actor | 19 | const byActor = overrodeByActor ? overrodeByActor : video.VideoChannel.Account.Actor |
18 | 20 | ||
19 | const url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString()) | 21 | const url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString()) |
22 | |||
23 | // Needed to build the AP object | ||
24 | if (!video.VideoCaptions) video.VideoCaptions = await video.$get('VideoCaptions') as VideoCaptionModel[] | ||
25 | |||
20 | const videoObject = video.toActivityPubObject() | 26 | const videoObject = video.toActivityPubObject() |
21 | const audience = getAudience(byActor, video.privacy === VideoPrivacy.PUBLIC) | 27 | const audience = getAudience(byActor, video.privacy === VideoPrivacy.PUBLIC) |
22 | 28 | ||