]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process-accept.ts
Federate video abuses
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process-accept.ts
index 37e42bd3a94c4e9959313260bab18eddd173fc79..9e0cd4032df31dccd63c4dbd0ff11b432954be9d 100644 (file)
@@ -7,7 +7,7 @@ async function processAcceptActivity (activity: ActivityAccept, inboxAccount?: A
 
   const targetAccount = await db.Account.loadByUrl(activity.actor)
 
-  return processFollow(inboxAccount, targetAccount)
+  return processAccept(inboxAccount, targetAccount)
 }
 
 // ---------------------------------------------------------------------------
@@ -18,10 +18,10 @@ export {
 
 // ---------------------------------------------------------------------------
 
-async function processFollow (account: AccountInstance, targetAccount: AccountInstance) {
+async function processAccept (account: AccountInstance, targetAccount: AccountInstance) {
   const follow = await db.AccountFollow.loadByAccountAndTarget(account.id, targetAccount.id)
   if (!follow) throw new Error('Cannot find associated follow.')
 
   follow.set('state', 'accepted')
-  return follow.save()
+  await follow.save()
 }