diff options
Diffstat (limited to 'server/controllers/activitypub/outbox.ts')
-rw-r--r-- | server/controllers/activitypub/outbox.ts | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts index ae7adcd4c..db69ae54b 100644 --- a/server/controllers/activitypub/outbox.ts +++ b/server/controllers/activitypub/outbox.ts | |||
@@ -5,11 +5,12 @@ import { activityPubCollectionPagination, activityPubContextify } from '../../he | |||
5 | import { logger } from '../../helpers/logger' | 5 | import { logger } from '../../helpers/logger' |
6 | import { announceActivityData, createActivityData } from '../../lib/activitypub/send' | 6 | import { announceActivityData, createActivityData } from '../../lib/activitypub/send' |
7 | import { buildAudience } from '../../lib/activitypub/audience' | 7 | import { buildAudience } from '../../lib/activitypub/audience' |
8 | import { asyncMiddleware, localAccountValidator } from '../../middlewares' | 8 | import { asyncMiddleware, localAccountValidator, localVideoChannelValidator } from '../../middlewares' |
9 | import { AccountModel } from '../../models/account/account' | 9 | import { AccountModel } from '../../models/account/account' |
10 | import { ActorModel } from '../../models/activitypub/actor' | 10 | import { ActorModel } from '../../models/activitypub/actor' |
11 | import { VideoModel } from '../../models/video/video' | 11 | import { VideoModel } from '../../models/video/video' |
12 | import { activityPubResponse } from './utils' | 12 | import { activityPubResponse } from './utils' |
13 | import { VideoChannelModel } from '../../models/video/video-channel' | ||
13 | 14 | ||
14 | const outboxRouter = express.Router() | 15 | const outboxRouter = express.Router() |
15 | 16 | ||
@@ -18,6 +19,11 @@ outboxRouter.get('/accounts/:name/outbox', | |||
18 | asyncMiddleware(outboxController) | 19 | asyncMiddleware(outboxController) |
19 | ) | 20 | ) |
20 | 21 | ||
22 | outboxRouter.get('/video-channels/:name/outbox', | ||
23 | localVideoChannelValidator, | ||
24 | asyncMiddleware(outboxController) | ||
25 | ) | ||
26 | |||
21 | // --------------------------------------------------------------------------- | 27 | // --------------------------------------------------------------------------- |
22 | 28 | ||
23 | export { | 29 | export { |
@@ -27,9 +33,9 @@ export { | |||
27 | // --------------------------------------------------------------------------- | 33 | // --------------------------------------------------------------------------- |
28 | 34 | ||
29 | async function outboxController (req: express.Request, res: express.Response, next: express.NextFunction) { | 35 | async function outboxController (req: express.Request, res: express.Response, next: express.NextFunction) { |
30 | const account: AccountModel = res.locals.account | 36 | const accountOrVideoChannel: AccountModel | VideoChannelModel = res.locals.account || res.locals.videoChannel |
31 | const actor = account.Actor | 37 | const actor = accountOrVideoChannel.Actor |
32 | const actorOutboxUrl = account.Actor.url + '/outbox' | 38 | const actorOutboxUrl = actor.url + '/outbox' |
33 | 39 | ||
34 | logger.info('Receiving outbox request for %s.', actorOutboxUrl) | 40 | logger.info('Receiving outbox request for %s.', actorOutboxUrl) |
35 | 41 | ||