diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-10 17:18:12 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-10 17:19:14 +0100 |
commit | 2ccaeeb341ffe8c2609039bf4c6d8835b4650316 (patch) | |
tree | a6bf6e05e7f02bc315e872d67a0b61ad6ad3d777 /server/controllers | |
parent | 759f8a29e95932023564ca98dcbc90d1acb92da0 (diff) | |
download | PeerTube-2ccaeeb341ffe8c2609039bf4c6d8835b4650316.tar.gz PeerTube-2ccaeeb341ffe8c2609039bf4c6d8835b4650316.tar.zst PeerTube-2ccaeeb341ffe8c2609039bf4c6d8835b4650316.zip |
Fetch remote AP objects
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) { |