aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-04 23:17:01 +0100
committerChocobozzz <me@florianbigard.com>2018-02-07 10:03:11 +0100
commit0bc22f8d7ef0ddb4becae2e9453378d3a0f88218 (patch)
tree7997b92da530c4632f5cf67d94a857c60b45ff5d /server/controllers/activitypub
parent6500a90cfeadae4959b73578612dc4a9cd917f05 (diff)
downloadPeerTube-0bc22f8d7ef0ddb4becae2e9453378d3a0f88218.tar.gz
PeerTube-0bc22f8d7ef0ddb4becae2e9453378d3a0f88218.tar.zst
PeerTube-0bc22f8d7ef0ddb4becae2e9453378d3a0f88218.zip
Correctly set the activity audience in outbox
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r--server/controllers/activitypub/outbox.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts
index 86cdcf4cd..c0c0c9d1c 100644
--- a/server/controllers/activitypub/outbox.ts
+++ b/server/controllers/activitypub/outbox.ts
@@ -1,5 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { Activity } from '../../../shared/models/activitypub/activity' 2import { Activity } from '../../../shared/models/activitypub/activity'
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 } from '../../initializers/constants' 6import { ACTIVITY_PUB } from '../../initializers/constants'
@@ -43,12 +44,12 @@ async function outboxController (req: express.Request, res: express.Response, ne
43 44
44 for (const video of data.data) { 45 for (const video of data.data) {
45 const byActor = video.VideoChannel.Account.Actor 46 const byActor = video.VideoChannel.Account.Actor
46 const createActivityAudience = buildAudience(followersMatrix[byActor.id]) 47 const createActivityAudience = buildAudience(followersMatrix[byActor.id], video.privacy === VideoPrivacy.PUBLIC)
47 48
48 // This is a shared video 49 // This is a shared video
49 if (video.VideoShares !== undefined && video.VideoShares.length !== 0) { 50 if (video.VideoShares !== undefined && video.VideoShares.length !== 0) {
50 const videoShare = video.VideoShares[0] 51 const videoShare = video.VideoShares[0]
51 const announceAudience = buildAudience(followersMatrix[actor.id]) 52 const announceAudience = buildAudience(followersMatrix[actor.id], video.privacy === VideoPrivacy.PUBLIC)
52 const announceActivity = await announceActivityData(videoShare.url, actor, video.url, undefined, announceAudience) 53 const announceActivity = await announceActivityData(videoShare.url, actor, video.url, undefined, announceAudience)
53 54
54 activities.push(announceActivity) 55 activities.push(announceActivity)