1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Improve activity pub actors implementation

This commit is contained in:
Chocobozzz 2018-03-22 18:40:33 +01:00
parent 9e841674da
commit 6be84cbcea
No known key found for this signature in database
GPG key ID: 583A612D890159BE
9 changed files with 32 additions and 12 deletions

View file

@ -1,4 +1,5 @@
import { ActivityReject } from '../../../../shared/models/activitypub/activity'
import { getActorUrl } from '../../../helpers/activitypub'
import { sequelizeTypescript } from '../../../initializers'
import { ActorModel } from '../../../models/activitypub/actor'
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
@ -6,7 +7,8 @@ import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
async function processRejectActivity (activity: ActivityReject, inboxActor?: ActorModel) {
if (inboxActor === undefined) throw new Error('Need to reject on explicit inbox.')
const targetActor = await ActorModel.loadByUrl(activity.actor)
const actorUrl = getActorUrl(activity.actor)
const targetActor = await ActorModel.loadByUrl(actorUrl)
return processReject(inboxActor, targetActor)
}