aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/activitypub/client.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts
index d1a761724..ec3f72b64 100644
--- a/server/controllers/activitypub/client.ts
+++ b/server/controllers/activitypub/client.ts
@@ -1,9 +1,11 @@
1// Intercept ActivityPub client requests 1// Intercept ActivityPub client requests
2import * as express from 'express' 2import * as express from 'express'
3import { VideoPrivacy } from '../../../shared/models/videos'
3import { activityPubCollectionPagination } from '../../helpers/activitypub' 4import { activityPubCollectionPagination } from '../../helpers/activitypub'
4import { pageToStartAndCount } from '../../helpers/core-utils' 5import { pageToStartAndCount } from '../../helpers/core-utils'
5import { ACTIVITY_PUB, CONFIG } from '../../initializers' 6import { ACTIVITY_PUB, CONFIG } from '../../initializers'
6import { buildVideoAnnounceToFollowers } from '../../lib/activitypub/send' 7import { buildVideoAnnounceToFollowers } from '../../lib/activitypub/send'
8import { audiencify, getAudience } from '../../lib/activitypub/send/misc'
7import { asyncMiddleware, executeIfActivityPub, localAccountValidator } from '../../middlewares' 9import { asyncMiddleware, executeIfActivityPub, localAccountValidator } from '../../middlewares'
8import { videoChannelsGetValidator, videosGetValidator, videosShareValidator } from '../../middlewares/validators' 10import { videoChannelsGetValidator, videosGetValidator, videosShareValidator } from '../../middlewares/validators'
9import { videoCommentGetValidator } from '../../middlewares/validators/video-comments' 11import { videoCommentGetValidator } from '../../middlewares/validators/video-comments'
@@ -95,7 +97,9 @@ async function videoController (req: express.Request, res: express.Response, nex
95 97
96 // We need more attributes 98 // We need more attributes
97 const videoAll = await VideoModel.loadAndPopulateAll(video.id) 99 const videoAll = await VideoModel.loadAndPopulateAll(video.id)
98 return res.json(videoAll.toActivityPubObject()) 100 const audience = await getAudience(video.VideoChannel.Account.Actor, undefined, video.privacy === VideoPrivacy.PUBLIC)
101
102 return res.json(audiencify(videoAll.toActivityPubObject(), audience))
99} 103}
100 104
101async function videoAnnounceController (req: express.Request, res: express.Response, next: express.NextFunction) { 105async function videoAnnounceController (req: express.Request, res: express.Response, next: express.NextFunction) {