aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/activitypub/client.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts
index ffbf1ba19..a342a48d4 100644
--- a/server/controllers/activitypub/client.ts
+++ b/server/controllers/activitypub/client.ts
@@ -39,6 +39,7 @@ import {
39import { VideoCaptionModel } from '../../models/video/video-caption' 39import { VideoCaptionModel } from '../../models/video/video-caption'
40import { videoRedundancyGetValidator } from '../../middlewares/validators/redundancy' 40import { videoRedundancyGetValidator } from '../../middlewares/validators/redundancy'
41import { getServerActor } from '../../helpers/utils' 41import { getServerActor } from '../../helpers/utils'
42import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
42 43
43const activityPubClientRouter = express.Router() 44const activityPubClientRouter = express.Router()
44 45
@@ -164,6 +165,8 @@ function getAccountVideoRate (rateType: VideoRateType) {
164async function videoController (req: express.Request, res: express.Response, next: express.NextFunction) { 165async function videoController (req: express.Request, res: express.Response, next: express.NextFunction) {
165 const video: VideoModel = res.locals.video 166 const video: VideoModel = res.locals.video
166 167
168 if (video.isOwned() === false) return res.redirect(video.url)
169
167 // We need captions to render AP object 170 // We need captions to render AP object
168 video.VideoCaptions = await VideoCaptionModel.listVideoCaptions(video.id) 171 video.VideoCaptions = await VideoCaptionModel.listVideoCaptions(video.id)
169 172
@@ -180,6 +183,9 @@ async function videoController (req: express.Request, res: express.Response, nex
180 183
181async function videoAnnounceController (req: express.Request, res: express.Response, next: express.NextFunction) { 184async function videoAnnounceController (req: express.Request, res: express.Response, next: express.NextFunction) {
182 const share = res.locals.videoShare as VideoShareModel 185 const share = res.locals.videoShare as VideoShareModel
186
187 if (share.Actor.isOwned() === false) return res.redirect(share.url)
188
183 const { activity } = await buildAnnounceWithVideoAudience(share.Actor, share, res.locals.video, undefined) 189 const { activity } = await buildAnnounceWithVideoAudience(share.Actor, share, res.locals.video, undefined)
184 190
185 return activityPubResponse(activityPubContextify(activity), res) 191 return activityPubResponse(activityPubContextify(activity), res)
@@ -252,6 +258,8 @@ async function videoChannelFollowingController (req: express.Request, res: expre
252async function videoCommentController (req: express.Request, res: express.Response, next: express.NextFunction) { 258async function videoCommentController (req: express.Request, res: express.Response, next: express.NextFunction) {
253 const videoComment: VideoCommentModel = res.locals.videoComment 259 const videoComment: VideoCommentModel = res.locals.videoComment
254 260
261 if (videoComment.isOwned() === false) return res.redirect(videoComment.url)
262
255 const threadParentComments = await VideoCommentModel.listThreadParentComments(videoComment, undefined) 263 const threadParentComments = await VideoCommentModel.listThreadParentComments(videoComment, undefined)
256 const isPublic = true // Comments are always public 264 const isPublic = true // Comments are always public
257 const audience = getAudience(videoComment.Account.Actor, isPublic) 265 const audience = getAudience(videoComment.Account.Actor, isPublic)
@@ -267,7 +275,9 @@ async function videoCommentController (req: express.Request, res: express.Respon
267} 275}
268 276
269async function videoRedundancyController (req: express.Request, res: express.Response) { 277async function videoRedundancyController (req: express.Request, res: express.Response) {
270 const videoRedundancy = res.locals.videoRedundancy 278 const videoRedundancy: VideoRedundancyModel = res.locals.videoRedundancy
279 if (videoRedundancy.isOwned() === false) return res.redirect(videoRedundancy.url)
280
271 const serverActor = await getServerActor() 281 const serverActor = await getServerActor()
272 282
273 const audience = getAudience(serverActor) 283 const audience = getAudience(serverActor)