diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-26 12:02:18 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-26 13:43:34 +0100 |
commit | 7acee6f18aac99e359360fc4f2362d5405135a79 (patch) | |
tree | a8eceaba9a01b913fcfca32f17f26b4f588a633e /server/controllers/activitypub | |
parent | d6e99e5322209a692cc3d870ddb5dcedbda69f2a (diff) | |
download | PeerTube-7acee6f18aac99e359360fc4f2362d5405135a79.tar.gz PeerTube-7acee6f18aac99e359360fc4f2362d5405135a79.tar.zst PeerTube-7acee6f18aac99e359360fc4f2362d5405135a79.zip |
Fix announce activities
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r-- | server/controllers/activitypub/outbox.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts index ab12a7c4b..41c6ffaeb 100644 --- a/server/controllers/activitypub/outbox.ts +++ b/server/controllers/activitypub/outbox.ts | |||
@@ -43,21 +43,18 @@ async function outboxController (req: express.Request, res: express.Response, ne | |||
43 | const followersMatrix = await ActorModel.getActorsFollowerSharedInboxUrls(actors, undefined) | 43 | const followersMatrix = await ActorModel.getActorsFollowerSharedInboxUrls(actors, undefined) |
44 | 44 | ||
45 | for (const video of data.data) { | 45 | for (const video of data.data) { |
46 | const videoObject = video.toActivityPubObject() | ||
47 | |||
48 | const byActor = video.VideoChannel.Account.Actor | 46 | const byActor = video.VideoChannel.Account.Actor |
49 | const createActivityAudience = buildAudience(followersMatrix[byActor.id]) | 47 | const createActivityAudience = buildAudience(followersMatrix[byActor.id]) |
50 | 48 | ||
51 | // This is a shared video | 49 | // This is a shared video |
52 | if (video.VideoShares !== undefined && video.VideoShares.length !== 0) { | 50 | if (video.VideoShares !== undefined && video.VideoShares.length !== 0) { |
53 | const createActivity = await createActivityData(video.url, byActor, videoObject, undefined, createActivityAudience) | ||
54 | |||
55 | const announceAudience = buildAudience(followersMatrix[actor.id]) | 51 | const announceAudience = buildAudience(followersMatrix[actor.id]) |
56 | const url = getAnnounceActivityPubUrl(video.url, actor) | 52 | const url = getAnnounceActivityPubUrl(video.url, actor) |
57 | const announceActivity = await announceActivityData(url, actor, createActivity, undefined, announceAudience) | 53 | const announceActivity = await announceActivityData(url, actor, video.url, undefined, announceAudience) |
58 | 54 | ||
59 | activities.push(announceActivity) | 55 | activities.push(announceActivity) |
60 | } else { | 56 | } else { |
57 | const videoObject = video.toActivityPubObject() | ||
61 | const createActivity = await createActivityData(video.url, byActor, videoObject, undefined, createActivityAudience) | 58 | const createActivity = await createActivityData(video.url, byActor, videoObject, undefined, createActivityAudience) |
62 | 59 | ||
63 | activities.push(createActivity) | 60 | activities.push(createActivity) |