aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/send
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/send')
-rw-r--r--server/lib/activitypub/send/send-announce.ts5
-rw-r--r--server/lib/activitypub/send/send-update.ts10
2 files changed, 12 insertions, 3 deletions
diff --git a/server/lib/activitypub/send/send-announce.ts b/server/lib/activitypub/send/send-announce.ts
index 1ab05ca3c..352813d73 100644
--- a/server/lib/activitypub/send/send-announce.ts
+++ b/server/lib/activitypub/send/send-announce.ts
@@ -20,7 +20,10 @@ async function sendVideoAnnounce (byActor: ActorModel, videoShare: VideoShareMod
20 20
21 logger.info('Creating job to send announce %s.', videoShare.url) 21 logger.info('Creating job to send announce %s.', videoShare.url)
22 22
23 return broadcastToFollowers(data, byActor, [ byActor ], t) 23 const actorsInvolvedInVideo = await getActorsInvolvedInVideo(video, t)
24 const followersException = [ byActor ]
25
26 return broadcastToFollowers(data, byActor, actorsInvolvedInVideo, t, followersException)
24} 27}
25 28
26function announceActivityData (url: string, byActor: ActorModel, object: string, audience?: ActivityAudience): ActivityAnnounce { 29function announceActivityData (url: string, byActor: ActorModel, object: string, audience?: ActivityAudience): ActivityAnnounce {
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'
10import { broadcastToFollowers } from './utils' 10import { broadcastToFollowers } from './utils'
11import { audiencify, getAudience } from '../audience' 11import { audiencify, getAudience } from '../audience'
12import { logger } from '../../../helpers/logger' 12import { logger } from '../../../helpers/logger'
13import { videoFeedsValidator } from '../../../middlewares/validators'
14import { VideoCaptionModel } from '../../../models/video/video-caption'
13 15
14async function sendUpdateVideo (video: VideoModel, t: Transaction) { 16async 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