aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/activitypub/client.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-10 17:18:12 +0100
committerChocobozzz <me@florianbigard.com>2018-01-10 17:19:14 +0100
commit2ccaeeb341ffe8c2609039bf4c6d8835b4650316 (patch)
treea6bf6e05e7f02bc315e872d67a0b61ad6ad3d777 /server/controllers/activitypub/client.ts
parent759f8a29e95932023564ca98dcbc90d1acb92da0 (diff)
downloadPeerTube-2ccaeeb341ffe8c2609039bf4c6d8835b4650316.tar.gz
PeerTube-2ccaeeb341ffe8c2609039bf4c6d8835b4650316.tar.zst
PeerTube-2ccaeeb341ffe8c2609039bf4c6d8835b4650316.zip
Fetch remote AP objects
Diffstat (limited to 'server/controllers/activitypub/client.ts')
-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) {