From 50d6de9c286abcb34ff4234d56d9cbb803db7665 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 14 Dec 2017 17:38:41 +0100 Subject: Begin moving video channel to actor --- server/lib/activitypub/send/send-accept.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'server/lib/activitypub/send/send-accept.ts') 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 @@ import { Transaction } from 'sequelize' import { ActivityAccept } from '../../../../shared/models/activitypub' -import { AccountModel } from '../../../models/account/account' -import { AccountFollowModel } from '../../../models/account/account-follow' -import { getAccountFollowAcceptActivityPubUrl } from '../url' +import { ActorModel } from '../../../models/activitypub/actor' +import { ActorFollowModel } from '../../../models/activitypub/actor-follow' +import { getActorFollowAcceptActivityPubUrl } from '../url' import { unicastTo } from './misc' -async function sendAccept (accountFollow: AccountFollowModel, t: Transaction) { - const follower = accountFollow.AccountFollower - const me = accountFollow.AccountFollowing +async function sendAccept (actorFollow: ActorFollowModel, t: Transaction) { + const follower = actorFollow.ActorFollower + const me = actorFollow.ActorFollowing - const url = getAccountFollowAcceptActivityPubUrl(accountFollow) + const url = getActorFollowAcceptActivityPubUrl(actorFollow) const data = acceptActivityData(url, me) return unicastTo(data, me, follower.inboxUrl, t) @@ -23,12 +23,10 @@ export { // --------------------------------------------------------------------------- -function acceptActivityData (url: string, byAccount: AccountModel) { - const activity: ActivityAccept = { +function acceptActivityData (url: string, byActor: ActorModel): ActivityAccept { + return { type: 'Accept', id: url, - actor: byAccount.url + actor: byActor.url } - - return activity } -- cgit v1.2.3