diff options
Diffstat (limited to 'server/lib/activitypub/send/send-accept.ts')
-rw-r--r-- | server/lib/activitypub/send/send-accept.ts | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/server/lib/activitypub/send/send-accept.ts b/server/lib/activitypub/send/send-accept.ts index f160af3c9..7579884a7 100644 --- a/server/lib/activitypub/send/send-accept.ts +++ b/server/lib/activitypub/send/send-accept.ts | |||
@@ -1,15 +1,15 @@ | |||
1 | import { Transaction } from 'sequelize' | 1 | import { Transaction } from 'sequelize' |
2 | import { ActivityAccept } from '../../../../shared/models/activitypub' | 2 | import { ActivityAccept } from '../../../../shared/models/activitypub' |
3 | import { AccountModel } from '../../../models/account/account' | 3 | import { ActorModel } from '../../../models/activitypub/actor' |
4 | import { AccountFollowModel } from '../../../models/account/account-follow' | 4 | import { ActorFollowModel } from '../../../models/activitypub/actor-follow' |
5 | import { getAccountFollowAcceptActivityPubUrl } from '../url' | 5 | import { getActorFollowAcceptActivityPubUrl } from '../url' |
6 | import { unicastTo } from './misc' | 6 | import { unicastTo } from './misc' |
7 | 7 | ||
8 | async function sendAccept (accountFollow: AccountFollowModel, t: Transaction) { | 8 | async function sendAccept (actorFollow: ActorFollowModel, t: Transaction) { |
9 | const follower = accountFollow.AccountFollower | 9 | const follower = actorFollow.ActorFollower |
10 | const me = accountFollow.AccountFollowing | 10 | const me = actorFollow.ActorFollowing |
11 | 11 | ||
12 | const url = getAccountFollowAcceptActivityPubUrl(accountFollow) | 12 | const url = getActorFollowAcceptActivityPubUrl(actorFollow) |
13 | const data = acceptActivityData(url, me) | 13 | const data = acceptActivityData(url, me) |
14 | 14 | ||
15 | return unicastTo(data, me, follower.inboxUrl, t) | 15 | return unicastTo(data, me, follower.inboxUrl, t) |
@@ -23,12 +23,10 @@ export { | |||
23 | 23 | ||
24 | // --------------------------------------------------------------------------- | 24 | // --------------------------------------------------------------------------- |
25 | 25 | ||
26 | function acceptActivityData (url: string, byAccount: AccountModel) { | 26 | function acceptActivityData (url: string, byActor: ActorModel): ActivityAccept { |
27 | const activity: ActivityAccept = { | 27 | return { |
28 | type: 'Accept', | 28 | type: 'Accept', |
29 | id: url, | 29 | id: url, |
30 | actor: byAccount.url | 30 | actor: byActor.url |
31 | } | 31 | } |
32 | |||
33 | return activity | ||
34 | } | 32 | } |