From 2186386cca113506791583cb07d6ccacba7af4e0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Jun 2018 20:04:58 +0200 Subject: Add concept of video state, and add ability to wait transcoding before publishing a video --- server/controllers/activitypub/client.ts | 8 ++++---- server/controllers/activitypub/outbox.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'server/controllers/activitypub') 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 async function videoController (req: express.Request, res: express.Response, next: express.NextFunction) { const video: VideoModel = res.locals.video - const audience = await getAudience(video.VideoChannel.Account.Actor, undefined, video.privacy === VideoPrivacy.PUBLIC) + const audience = getAudience(video.VideoChannel.Account.Actor, video.privacy === VideoPrivacy.PUBLIC) const videoObject = audiencify(video.toActivityPubObject(), audience) if (req.path.endsWith('/activity')) { - const data = await createActivityData(video.url, video.VideoChannel.Account.Actor, videoObject, undefined, audience) + const data = createActivityData(video.url, video.VideoChannel.Account.Actor, videoObject, audience) return activityPubResponse(activityPubContextify(data), res) } @@ -210,12 +210,12 @@ async function videoCommentController (req: express.Request, res: express.Respon const threadParentComments = await VideoCommentModel.listThreadParentComments(videoComment, undefined) const isPublic = true // Comments are always public - const audience = await getAudience(videoComment.Account.Actor, undefined, isPublic) + const audience = getAudience(videoComment.Account.Actor, isPublic) const videoCommentObject = audiencify(videoComment.toActivityPubObject(threadParentComments), audience) if (req.path.endsWith('/activity')) { - const data = await createActivityData(videoComment.url, videoComment.Account.Actor, videoCommentObject, undefined, audience) + const data = createActivityData(videoComment.url, videoComment.Account.Actor, videoCommentObject, audience) return activityPubResponse(activityPubContextify(data), res) } 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) // This is a shared video if (video.VideoShares !== undefined && video.VideoShares.length !== 0) { const videoShare = video.VideoShares[0] - const announceActivity = await announceActivityData(videoShare.url, actor, video.url, undefined, createActivityAudience) + const announceActivity = announceActivityData(videoShare.url, actor, video.url, createActivityAudience) activities.push(announceActivity) } else { const videoObject = video.toActivityPubObject() - const createActivity = await createActivityData(video.url, byActor, videoObject, undefined, createActivityAudience) + const createActivity = createActivityData(video.url, byActor, videoObject, createActivityAudience) activities.push(createActivity) } -- cgit v1.2.3