mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Send follow/accept
This commit is contained in:
parent
7a7724e66e
commit
ce548a10db
9 changed files with 160 additions and 19 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue