mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Improve activity pub actors implementation
This commit is contained in:
parent
9e841674da
commit
6be84cbcea
9 changed files with 32 additions and 12 deletions
|
@ -1,4 +1,5 @@
|
|||
import { ActivityAccept } from '../../../../shared/models/activitypub'
|
||||
import { getActorUrl } from '../../../helpers/activitypub'
|
||||
import { ActorModel } from '../../../models/activitypub/actor'
|
||||
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
|
||||
import { addFetchOutboxJob } from '../fetch'
|
||||
|
@ -6,7 +7,8 @@ import { addFetchOutboxJob } from '../fetch'
|
|||
async function processAcceptActivity (activity: ActivityAccept, inboxActor?: ActorModel) {
|
||||
if (inboxActor === undefined) throw new Error('Need to accept on explicit inbox.')
|
||||
|
||||
const targetActor = await ActorModel.loadByUrl(activity.actor)
|
||||
const actorUrl = getActorUrl(activity.actor)
|
||||
const targetActor = await ActorModel.loadByUrl(actorUrl)
|
||||
|
||||
return processAccept(inboxActor, targetActor)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue