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.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/lib/activitypub/process/process-accept.ts b/server/lib/activitypub/process/process-accept.ts
index 73c6cb279..5b321f771 100644
--- a/server/lib/activitypub/process/process-accept.ts
+++ b/server/lib/activitypub/process/process-accept.ts
@@ -1,12 +1,12 @@
1import { ActivityAccept } from '../../../../shared/models/activitypub/activity' 1import { ActivityAccept } from '../../../../shared/models/activitypub'
2import { database as db } from '../../../initializers' 2import { AccountModel } from '../../../models/account/account'
3import { AccountInstance } from '../../../models/account/account-interface' 3import { AccountFollowModel } from '../../../models/account/account-follow'
4import { addFetchOutboxJob } from '../fetch' 4import { addFetchOutboxJob } from '../fetch'
5 5
6async function processAcceptActivity (activity: ActivityAccept, inboxAccount?: AccountInstance) { 6async function processAcceptActivity (activity: ActivityAccept, inboxAccount?: AccountModel) {
7 if (inboxAccount === undefined) throw new Error('Need to accept on explicit inbox.') 7 if (inboxAccount === undefined) throw new Error('Need to accept on explicit inbox.')
8 8
9 const targetAccount = await db.Account.loadByUrl(activity.actor) 9 const targetAccount = await AccountModel.loadByUrl(activity.actor)
10 10
11 return processAccept(inboxAccount, targetAccount) 11 return processAccept(inboxAccount, targetAccount)
12} 12}
@@ -19,8 +19,8 @@ export {
19 19
20// --------------------------------------------------------------------------- 20// ---------------------------------------------------------------------------
21 21
22async function processAccept (account: AccountInstance, targetAccount: AccountInstance) { 22async function processAccept (account: AccountModel, targetAccount: AccountModel) {
23 const follow = await db.AccountFollow.loadByAccountAndTarget(account.id, targetAccount.id) 23 const follow = await AccountFollowModel.loadByAccountAndTarget(account.id, targetAccount.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')