aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-26 15:49:57 +0100
committerChocobozzz <me@florianbigard.com>2018-01-26 15:49:57 +0100
commit4ba3b8ea1be85d95a508ac479f26b96ceea15971 (patch)
treef76de3c6ec591cf885e5000f0e369aab883f3d95 /server/controllers/activitypub
parent7859b5800c08c15f3380fb3a7e267ce1b3f2df9f (diff)
downloadPeerTube-4ba3b8ea1be85d95a508ac479f26b96ceea15971.tar.gz
PeerTube-4ba3b8ea1be85d95a508ac479f26b96ceea15971.tar.zst
PeerTube-4ba3b8ea1be85d95a508ac479f26b96ceea15971.zip
Don't rehost announced video activities
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r--server/controllers/activitypub/client.ts2
-rw-r--r--server/controllers/activitypub/outbox.ts5
2 files changed, 3 insertions, 4 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts
index 2587ee212..7b60cc311 100644
--- a/server/controllers/activitypub/client.ts
+++ b/server/controllers/activitypub/client.ts
@@ -100,7 +100,7 @@ async function videoController (req: express.Request, res: express.Response, nex
100 100
101async function videoAnnounceController (req: express.Request, res: express.Response, next: express.NextFunction) { 101async function videoAnnounceController (req: express.Request, res: express.Response, next: express.NextFunction) {
102 const share = res.locals.videoShare as VideoShareModel 102 const share = res.locals.videoShare as VideoShareModel
103 const object = await buildVideoAnnounceToFollowers(share.Actor, res.locals.video, undefined) 103 const object = await buildVideoAnnounceToFollowers(share.Actor, share, res.locals.video, undefined)
104 104
105 return res.json(activityPubContextify(object)) 105 return res.json(activityPubContextify(object))
106} 106}
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts
index 41c6ffaeb..86cdcf4cd 100644
--- a/server/controllers/activitypub/outbox.ts
+++ b/server/controllers/activitypub/outbox.ts
@@ -5,7 +5,6 @@ import { pageToStartAndCount } from '../../helpers/core-utils'
5import { ACTIVITY_PUB } from '../../initializers/constants' 5import { ACTIVITY_PUB } from '../../initializers/constants'
6import { announceActivityData, createActivityData } from '../../lib/activitypub/send' 6import { announceActivityData, createActivityData } from '../../lib/activitypub/send'
7import { buildAudience } from '../../lib/activitypub/send/misc' 7import { buildAudience } from '../../lib/activitypub/send/misc'
8import { getAnnounceActivityPubUrl } from '../../lib/activitypub/url'
9import { asyncMiddleware, localAccountValidator } from '../../middlewares' 8import { asyncMiddleware, localAccountValidator } from '../../middlewares'
10import { AccountModel } from '../../models/account/account' 9import { AccountModel } from '../../models/account/account'
11import { ActorModel } from '../../models/activitypub/actor' 10import { ActorModel } from '../../models/activitypub/actor'
@@ -48,9 +47,9 @@ async function outboxController (req: express.Request, res: express.Response, ne
48 47
49 // This is a shared video 48 // This is a shared video
50 if (video.VideoShares !== undefined && video.VideoShares.length !== 0) { 49 if (video.VideoShares !== undefined && video.VideoShares.length !== 0) {
50 const videoShare = video.VideoShares[0]
51 const announceAudience = buildAudience(followersMatrix[actor.id]) 51 const announceAudience = buildAudience(followersMatrix[actor.id])
52 const url = getAnnounceActivityPubUrl(video.url, actor) 52 const announceActivity = await announceActivityData(videoShare.url, actor, video.url, undefined, announceAudience)
53 const announceActivity = await announceActivityData(url, actor, video.url, undefined, announceAudience)
54 53
55 activities.push(announceActivity) 54 activities.push(announceActivity)
56 } else { 55 } else {