aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/process/process-accept.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/process/process-accept.ts')
-rw-r--r--server/lib/activitypub/process/process-accept.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/lib/activitypub/process/process-accept.ts b/server/lib/activitypub/process/process-accept.ts
index 5b321f771..b9d906ec9 100644
--- a/server/lib/activitypub/process/process-accept.ts
+++ b/server/lib/activitypub/process/process-accept.ts
@@ -1,14 +1,14 @@
1import { ActivityAccept } from '../../../../shared/models/activitypub' 1import { ActivityAccept } from '../../../../shared/models/activitypub'
2import { AccountModel } from '../../../models/account/account' 2import { ActorModel } from '../../../models/activitypub/actor'
3import { AccountFollowModel } from '../../../models/account/account-follow' 3import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
4import { addFetchOutboxJob } from '../fetch' 4import { addFetchOutboxJob } from '../fetch'
5 5
6async function processAcceptActivity (activity: ActivityAccept, inboxAccount?: AccountModel) { 6async function processAcceptActivity (activity: ActivityAccept, inboxActor?: ActorModel) {
7 if (inboxAccount === undefined) throw new Error('Need to accept on explicit inbox.') 7 if (inboxActor === undefined) throw new Error('Need to accept on explicit inbox.')
8 8
9 const targetAccount = await AccountModel.loadByUrl(activity.actor) 9 const targetActor = await ActorModel.loadByUrl(activity.actor)
10 10
11 return processAccept(inboxAccount, targetAccount) 11 return processAccept(inboxActor, targetActor)
12} 12}
13 13
14// --------------------------------------------------------------------------- 14// ---------------------------------------------------------------------------
@@ -19,11 +19,11 @@ export {
19 19
20// --------------------------------------------------------------------------- 20// ---------------------------------------------------------------------------
21 21
22async function processAccept (account: AccountModel, targetAccount: AccountModel) { 22async function processAccept (actor: ActorModel, targetActor: ActorModel) {
23 const follow = await AccountFollowModel.loadByAccountAndTarget(account.id, targetAccount.id) 23 const follow = await ActorFollowModel.loadByActorAndTarget(actor.id, targetActor.id)
24 if (!follow) throw new Error('Cannot find associated follow.') 24 if (!follow) throw new Error('Cannot find associated follow.')
25 25
26 follow.set('state', 'accepted') 26 follow.set('state', 'accepted')
27 await follow.save() 27 await follow.save()
28 await addFetchOutboxJob(targetAccount, undefined) 28 await addFetchOutboxJob(targetActor, undefined)
29} 29}