diff options
Diffstat (limited to 'server/controllers/activitypub/inbox.ts')
-rw-r--r-- | server/controllers/activitypub/inbox.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index 88a0834f6..8332eabb1 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts | |||
@@ -5,6 +5,7 @@ import { isActivityValid } from '../../helpers/custom-validators/activitypub/act | |||
5 | import { processActivities } from '../../lib/activitypub/process/process' | 5 | import { processActivities } from '../../lib/activitypub/process/process' |
6 | import { asyncMiddleware, checkSignature, localAccountValidator, signatureValidator } from '../../middlewares' | 6 | import { asyncMiddleware, checkSignature, localAccountValidator, signatureValidator } from '../../middlewares' |
7 | import { activityPubValidator } from '../../middlewares/validators/activitypub/activity' | 7 | import { activityPubValidator } from '../../middlewares/validators/activitypub/activity' |
8 | import { ActorModel } from '../../models/activitypub/actor' | ||
8 | 9 | ||
9 | const inboxRouter = express.Router() | 10 | const inboxRouter = express.Router() |
10 | 11 | ||
@@ -48,7 +49,14 @@ async function inboxController (req: express.Request, res: express.Response, nex | |||
48 | activities = activities.filter(a => isActivityValid(a)) | 49 | activities = activities.filter(a => isActivityValid(a)) |
49 | logger.debug('We keep %d activities.', activities.length, { activities }) | 50 | logger.debug('We keep %d activities.', activities.length, { activities }) |
50 | 51 | ||
51 | await processActivities(activities, res.locals.signature.account, res.locals.account) | 52 | let specificActor: ActorModel = undefined |
53 | if (res.locals.account) { | ||
54 | specificActor = res.locals.account | ||
55 | } else if (res.locals.videoChannel) { | ||
56 | specificActor = res.locals.videoChannel | ||
57 | } | ||
58 | |||
59 | await processActivities(activities, res.locals.signature.actor, specificActor) | ||
52 | 60 | ||
53 | res.status(204).end() | 61 | res.status(204).end() |
54 | } | 62 | } |