aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/send/send-follow.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-follow.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-follow.ts')
-rw-r--r--server/lib/activitypub/send/send-follow.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/lib/activitypub/send/send-follow.ts b/server/lib/activitypub/send/send-follow.ts
index 51735ddfd..eac60e94f 100644
--- a/server/lib/activitypub/send/send-follow.ts
+++ b/server/lib/activitypub/send/send-follow.ts
@@ -1,26 +1,26 @@
1import { Transaction } from 'sequelize' 1import { Transaction } from 'sequelize'
2import { ActivityFollow } from '../../../../shared/models/activitypub' 2import { ActivityFollow } 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 { getAccountFollowActivityPubUrl } from '../url' 5import { getActorFollowActivityPubUrl } from '../url'
6import { unicastTo } from './misc' 6import { unicastTo } from './misc'
7 7
8function sendFollow (accountFollow: AccountFollowModel, t: Transaction) { 8function sendFollow (actorFollow: ActorFollowModel, t: Transaction) {
9 const me = accountFollow.AccountFollower 9 const me = actorFollow.ActorFollower
10 const following = accountFollow.AccountFollowing 10 const following = actorFollow.ActorFollowing
11 11
12 const url = getAccountFollowActivityPubUrl(accountFollow) 12 const url = getActorFollowActivityPubUrl(actorFollow)
13 const data = followActivityData(url, me, following) 13 const data = followActivityData(url, me, following)
14 14
15 return unicastTo(data, me, following.inboxUrl, t) 15 return unicastTo(data, me, following.inboxUrl, t)
16} 16}
17 17
18function followActivityData (url: string, byAccount: AccountModel, targetAccount: AccountModel): ActivityFollow { 18function followActivityData (url: string, byActor: ActorModel, targetActor: ActorModel): ActivityFollow {
19 return { 19 return {
20 type: 'Follow', 20 type: 'Follow',
21 id: url, 21 id: url,
22 actor: byAccount.url, 22 actor: byActor.url,
23 object: targetAccount.url 23 object: targetActor.url
24 } 24 }
25} 25}
26 26