diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-04 23:17:01 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-07 10:03:11 +0100 |
commit | 0bc22f8d7ef0ddb4becae2e9453378d3a0f88218 (patch) | |
tree | 7997b92da530c4632f5cf67d94a857c60b45ff5d | |
parent | 6500a90cfeadae4959b73578612dc4a9cd917f05 (diff) | |
download | PeerTube-0bc22f8d7ef0ddb4becae2e9453378d3a0f88218.tar.gz PeerTube-0bc22f8d7ef0ddb4becae2e9453378d3a0f88218.tar.zst PeerTube-0bc22f8d7ef0ddb4becae2e9453378d3a0f88218.zip |
Correctly set the activity audience in outbox
-rw-r--r-- | server/controllers/activitypub/outbox.ts | 5 |
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 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { Activity } from '../../../shared/models/activitypub/activity' | 2 | import { Activity } from '../../../shared/models/activitypub/activity' |
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 } from '../../initializers/constants' | 6 | import { 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) |