From 0bc22f8d7ef0ddb4becae2e9453378d3a0f88218 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 4 Feb 2018 23:17:01 +0100 Subject: Correctly set the activity audience in outbox --- server/controllers/activitypub/outbox.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'server/controllers/activitypub') 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 @@ import * as express from 'express' import { Activity } from '../../../shared/models/activitypub/activity' +import { VideoPrivacy } from '../../../shared/models/videos' import { activityPubCollectionPagination } from '../../helpers/activitypub' import { pageToStartAndCount } from '../../helpers/core-utils' import { ACTIVITY_PUB } from '../../initializers/constants' @@ -43,12 +44,12 @@ async function outboxController (req: express.Request, res: express.Response, ne for (const video of data.data) { const byActor = video.VideoChannel.Account.Actor - const createActivityAudience = buildAudience(followersMatrix[byActor.id]) + const createActivityAudience = buildAudience(followersMatrix[byActor.id], video.privacy === VideoPrivacy.PUBLIC) // This is a shared video if (video.VideoShares !== undefined && video.VideoShares.length !== 0) { const videoShare = video.VideoShares[0] - const announceAudience = buildAudience(followersMatrix[actor.id]) + const announceAudience = buildAudience(followersMatrix[actor.id], video.privacy === VideoPrivacy.PUBLIC) const announceActivity = await announceActivityData(videoShare.url, actor, video.url, undefined, announceAudience) activities.push(announceActivity) -- cgit v1.2.3