From 598edb8af1cc7e5ea3ead1ec9c96c4853b90be36 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 3 Feb 2020 11:12:29 +0100 Subject: Reduce AP context size on specific activities --- server/lib/job-queue/handlers/utils/activitypub-http-utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/lib/job-queue/handlers/utils') diff --git a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts index a28f3596f..54b35840d 100644 --- a/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts +++ b/server/lib/job-queue/handlers/utils/activitypub-http-utils.ts @@ -1,11 +1,11 @@ -import { buildSignedActivity } from '../../../../helpers/activitypub' +import { buildSignedActivity, ContextType } from '../../../../helpers/activitypub' import { getServerActor } from '../../../../helpers/utils' import { ActorModel } from '../../../../models/activitypub/actor' import { sha256 } from '../../../../helpers/core-utils' import { HTTP_SIGNATURE } from '../../../../initializers/constants' import { MActor } from '../../../../typings/models' -type Payload = { body: any, signatureActorId?: number } +type Payload = { body: any, contextType?: ContextType, signatureActorId?: number } async function computeBody (payload: Payload) { let body = payload.body @@ -13,7 +13,7 @@ async function computeBody (payload: Payload) { if (payload.signatureActorId) { const actorSignature = await ActorModel.load(payload.signatureActorId) if (!actorSignature) throw new Error('Unknown signature actor id.') - body = await buildSignedActivity(actorSignature, payload.body) + body = await buildSignedActivity(actorSignature, payload.body, payload.contextType) } return body -- cgit v1.2.3