diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:04:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-12 20:37:51 +0200 |
commit | 2186386cca113506791583cb07d6ccacba7af4e0 (patch) | |
tree | 3c214c0b5fbd64332624267fa6e51fd4a9cf6474 /server/controllers/activitypub | |
parent | 6ccdf3a23ecec5ba2eeaf487fd1fafdc7606b4bf (diff) | |
download | PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.gz PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.tar.zst PeerTube-2186386cca113506791583cb07d6ccacba7af4e0.zip |
Add concept of video state, and add ability to wait transcoding before
publishing a video
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r-- | server/controllers/activitypub/client.ts | 8 | ||||
-rw-r--r-- | server/controllers/activitypub/outbox.ts | 4 |
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 | |||
123 | async function videoController (req: express.Request, res: express.Response, next: express.NextFunction) { | 123 | async 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 | } |