aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/send/send-accept.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-14 17:38:41 +0100
committerChocobozzz <me@florianbigard.com>2017-12-19 10:53:16 +0100
commit50d6de9c286abcb34ff4234d56d9cbb803db7665 (patch)
treef1732b27edcd05c7877a8358b8312f1e38c287ed /server/lib/activitypub/send/send-accept.ts
parentfadf619ad61a016c1c7fc53de5a8f398a4f77519 (diff)
downloadPeerTube-50d6de9c286abcb34ff4234d56d9cbb803db7665.tar.gz
PeerTube-50d6de9c286abcb34ff4234d56d9cbb803db7665.tar.zst
PeerTube-50d6de9c286abcb34ff4234d56d9cbb803db7665.zip
Begin moving video channel to actor
Diffstat (limited to 'server/lib/activitypub/send/send-accept.ts')
-rw-r--r--server/lib/activitypub/send/send-accept.ts22
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 @@
1import { Transaction } from 'sequelize' 1import { Transaction } from 'sequelize'
2import { ActivityAccept } from '../../../../shared/models/activitypub' 2import { ActivityAccept } from '../../../../shared/models/activitypub'
3import { AccountModel } from '../../../models/account/account' 3import { ActorModel } from '../../../models/activitypub/actor'
4import { AccountFollowModel } from '../../../models/account/account-follow' 4import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
5import { getAccountFollowAcceptActivityPubUrl } from '../url' 5import { getActorFollowAcceptActivityPubUrl } from '../url'
6import { unicastTo } from './misc' 6import { unicastTo } from './misc'
7 7
8async function sendAccept (accountFollow: AccountFollowModel, t: Transaction) { 8async 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
26function acceptActivityData (url: string, byAccount: AccountModel) { 26function 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}