diff options
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r-- | server/controllers/activitypub/client.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index d0f761009..8e064fb5b 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts | |||
@@ -27,7 +27,7 @@ import { | |||
27 | videosShareValidator | 27 | videosShareValidator |
28 | } from '../../middlewares' | 28 | } from '../../middlewares' |
29 | import { cacheRoute } from '../../middlewares/cache/cache' | 29 | import { cacheRoute } from '../../middlewares/cache/cache' |
30 | import { getAccountVideoRateValidatorFactory, videoCommentGetValidator } from '../../middlewares/validators' | 30 | import { getAccountVideoRateValidatorFactory, getVideoLocalViewerValidator, videoCommentGetValidator } from '../../middlewares/validators' |
31 | import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy' | 31 | import { videoFileRedundancyGetValidator, videoPlaylistRedundancyGetValidator } from '../../middlewares/validators/redundancy' |
32 | import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists' | 32 | import { videoPlaylistElementAPGetValidator, videoPlaylistsGetValidator } from '../../middlewares/validators/videos/video-playlists' |
33 | import { AccountModel } from '../../models/account/account' | 33 | import { AccountModel } from '../../models/account/account' |
@@ -175,6 +175,12 @@ activityPubClientRouter.get('/video-playlists/:playlistId/videos/:playlistElemen | |||
175 | videoPlaylistElementController | 175 | videoPlaylistElementController |
176 | ) | 176 | ) |
177 | 177 | ||
178 | activityPubClientRouter.get('/videos/local-viewer/:localViewerId', | ||
179 | executeIfActivityPub, | ||
180 | asyncMiddleware(getVideoLocalViewerValidator), | ||
181 | getVideoLocalViewerController | ||
182 | ) | ||
183 | |||
178 | // --------------------------------------------------------------------------- | 184 | // --------------------------------------------------------------------------- |
179 | 185 | ||
180 | export { | 186 | export { |
@@ -399,6 +405,12 @@ function videoPlaylistElementController (req: express.Request, res: express.Resp | |||
399 | return activityPubResponse(activityPubContextify(json, 'Playlist'), res) | 405 | return activityPubResponse(activityPubContextify(json, 'Playlist'), res) |
400 | } | 406 | } |
401 | 407 | ||
408 | function getVideoLocalViewerController (req: express.Request, res: express.Response) { | ||
409 | const localViewer = res.locals.localViewerFull | ||
410 | |||
411 | return activityPubResponse(activityPubContextify(localViewer.toActivityPubObject(), 'WatchAction'), res) | ||
412 | } | ||
413 | |||
402 | // --------------------------------------------------------------------------- | 414 | // --------------------------------------------------------------------------- |
403 | 415 | ||
404 | function actorFollowing (req: express.Request, actor: MActorId) { | 416 | function actorFollowing (req: express.Request, actor: MActorId) { |