mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Improve AP actor checks
This commit is contained in:
parent
e587e0ecee
commit
12ba460e9e
5 changed files with 30 additions and 21 deletions
|
@ -17,11 +17,11 @@ export {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
async function processReject (actor: ActorModel, targetActor: ActorModel) {
|
||||
async function processReject (follower: ActorModel, targetActor: ActorModel) {
|
||||
return sequelizeTypescript.transaction(async t => {
|
||||
const actorFollow = await ActorFollowModel.loadByActorAndTarget(actor.id, targetActor.id, t)
|
||||
const actorFollow = await ActorFollowModel.loadByActorAndTarget(follower.id, targetActor.id, t)
|
||||
|
||||
if (!actorFollow) throw new Error(`'Unknown actor follow ${actor.id} -> ${targetActor.id}.`)
|
||||
if (!actorFollow) throw new Error(`'Unknown actor follow ${follower.id} -> ${targetActor.id}.`)
|
||||
|
||||
await actorFollow.destroy({ transaction: t })
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue