diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/activitypub/client.ts | 6 |
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 |
2 | import * as express from 'express' | 2 | import * as express from 'express' |
3 | import { VideoPrivacy } from '../../../shared/models/videos' | ||
3 | import { activityPubCollectionPagination } from '../../helpers/activitypub' | 4 | import { activityPubCollectionPagination } from '../../helpers/activitypub' |
4 | import { pageToStartAndCount } from '../../helpers/core-utils' | 5 | import { pageToStartAndCount } from '../../helpers/core-utils' |
5 | import { ACTIVITY_PUB, CONFIG } from '../../initializers' | 6 | import { ACTIVITY_PUB, CONFIG } from '../../initializers' |
6 | import { buildVideoAnnounceToFollowers } from '../../lib/activitypub/send' | 7 | import { buildVideoAnnounceToFollowers } from '../../lib/activitypub/send' |
8 | import { audiencify, getAudience } from '../../lib/activitypub/send/misc' | ||
7 | import { asyncMiddleware, executeIfActivityPub, localAccountValidator } from '../../middlewares' | 9 | import { asyncMiddleware, executeIfActivityPub, localAccountValidator } from '../../middlewares' |
8 | import { videoChannelsGetValidator, videosGetValidator, videosShareValidator } from '../../middlewares/validators' | 10 | import { videoChannelsGetValidator, videosGetValidator, videosShareValidator } from '../../middlewares/validators' |
9 | import { videoCommentGetValidator } from '../../middlewares/validators/video-comments' | 11 | import { 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 | ||
101 | async function videoAnnounceController (req: express.Request, res: express.Response, next: express.NextFunction) { | 105 | async function videoAnnounceController (req: express.Request, res: express.Response, next: express.NextFunction) { |