mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Stronger actor association typing in AP functions
This commit is contained in:
parent
511765c9f8
commit
5224c394b3
31 changed files with 146 additions and 89 deletions
|
@ -3,6 +3,7 @@ import { ActorModel } from '../../../models/activitypub/actor'
|
|||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||
import { addFetchOutboxJob } from '../actor'
|
||||
import { APProcessorOptions } from '../../../typings/activitypub-processor.model'
|
||||
import { SignatureActorModel } from '../../../typings/models'
|
||||
|
||||
async function processAcceptActivity (options: APProcessorOptions<ActivityAccept>) {
|
||||
const { byActor: targetActor, inboxActor } = options
|
||||
|
@ -19,7 +20,7 @@ export {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
async function processAccept (actor: ActorModel, targetActor: ActorModel) {
|
||||
async function processAccept (actor: ActorModel, targetActor: SignatureActorModel) {
|
||||
const follow = await ActorFollowModel.loadByActorAndTarget(actor.id, targetActor.id)
|
||||
if (!follow) throw new Error('Cannot find associated follow.')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue