1
0
Fork 0
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:
Chocobozzz 2017-11-13 18:48:28 +01:00
parent 7a7724e66e
commit ce548a10db
No known key found for this signature in database
GPG key ID: 583A612D890159BE
9 changed files with 160 additions and 19 deletions

View 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()
}