aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/activitypub
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r--server/controllers/activitypub/client.ts8
-rw-r--r--server/controllers/activitypub/outbox.ts4
2 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts
index 1c780783c..ea8e25f68 100644
--- a/server/controllers/activitypub/client.ts
+++ b/server/controllers/activitypub/client.ts
@@ -123,11 +123,11 @@ async function accountFollowingController (req: express.Request, res: express.Re
123async function videoController (req: express.Request, res: express.Response, next: express.NextFunction) { 123async function videoController (req: express.Request, res: express.Response, next: express.NextFunction) {
124 const video: VideoModel = res.locals.video 124 const video: VideoModel = res.locals.video
125 125
126 const audience = await getAudience(video.VideoChannel.Account.Actor, undefined, video.privacy === VideoPrivacy.PUBLIC) 126 const audience = getAudience(video.VideoChannel.Account.Actor, video.privacy === VideoPrivacy.PUBLIC)
127 const videoObject = audiencify(video.toActivityPubObject(), audience) 127 const videoObject = audiencify(video.toActivityPubObject(), audience)
128 128
129 if (req.path.endsWith('/activity')) { 129 if (req.path.endsWith('/activity')) {
130 const data = await createActivityData(video.url, video.VideoChannel.Account.Actor, videoObject, undefined, audience) 130 const data = createActivityData(video.url, video.VideoChannel.Account.Actor, videoObject, audience)
131 return activityPubResponse(activityPubContextify(data), res) 131 return activityPubResponse(activityPubContextify(data), res)
132 } 132 }
133 133
@@ -210,12 +210,12 @@ async function videoCommentController (req: express.Request, res: express.Respon
210 210
211 const threadParentComments = await VideoCommentModel.listThreadParentComments(videoComment, undefined) 211 const threadParentComments = await VideoCommentModel.listThreadParentComments(videoComment, undefined)
212 const isPublic = true // Comments are always public 212 const isPublic = true // Comments are always public
213 const audience = await getAudience(videoComment.Account.Actor, undefined, isPublic) 213 const audience = getAudience(videoComment.Account.Actor, isPublic)
214 214
215 const videoCommentObject = audiencify(videoComment.toActivityPubObject(threadParentComments), audience) 215 const videoCommentObject = audiencify(videoComment.toActivityPubObject(threadParentComments), audience)
216 216
217 if (req.path.endsWith('/activity')) { 217 if (req.path.endsWith('/activity')) {
218 const data = await createActivityData(videoComment.url, videoComment.Account.Actor, videoCommentObject, undefined, audience) 218 const data = createActivityData(videoComment.url, videoComment.Account.Actor, videoCommentObject, audience)
219 return activityPubResponse(activityPubContextify(data), res) 219 return activityPubResponse(activityPubContextify(data), res)
220 } 220 }
221 221
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts
index 2793ae267..ae7adcd4c 100644
--- a/server/controllers/activitypub/outbox.ts
+++ b/server/controllers/activitypub/outbox.ts
@@ -54,12 +54,12 @@ async function buildActivities (actor: ActorModel, start: number, count: number)
54 // This is a shared video 54 // This is a shared video
55 if (video.VideoShares !== undefined && video.VideoShares.length !== 0) { 55 if (video.VideoShares !== undefined && video.VideoShares.length !== 0) {
56 const videoShare = video.VideoShares[0] 56 const videoShare = video.VideoShares[0]
57 const announceActivity = await announceActivityData(videoShare.url, actor, video.url, undefined, createActivityAudience) 57 const announceActivity = announceActivityData(videoShare.url, actor, video.url, createActivityAudience)
58 58
59 activities.push(announceActivity) 59 activities.push(announceActivity)
60 } else { 60 } else {
61 const videoObject = video.toActivityPubObject() 61 const videoObject = video.toActivityPubObject()
62 const createActivity = await createActivityData(video.url, byActor, videoObject, undefined, createActivityAudience) 62 const createActivity = createActivityData(video.url, byActor, videoObject, createActivityAudience)
63 63
64 activities.push(createActivity) 64 activities.push(createActivity)
65 } 65 }