diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-12 17:53:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-13 16:50:33 +0100 |
commit | 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch) | |
tree | e5ca358287fca6ecacce83defcf23af1e8e9f419 /server/lib/activitypub/send/send-follow.ts | |
parent | c893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff) | |
download | PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.gz PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.zst PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.zip |
Move models to typescript-sequelize
Diffstat (limited to 'server/lib/activitypub/send/send-follow.ts')
-rw-r--r-- | server/lib/activitypub/send/send-follow.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/server/lib/activitypub/send/send-follow.ts b/server/lib/activitypub/send/send-follow.ts index 8fba1b6b5..51735ddfd 100644 --- a/server/lib/activitypub/send/send-follow.ts +++ b/server/lib/activitypub/send/send-follow.ts | |||
@@ -1,11 +1,11 @@ | |||
1 | import { Transaction } from 'sequelize' | 1 | import { Transaction } from 'sequelize' |
2 | import { ActivityFollow } from '../../../../shared/models/activitypub/activity' | 2 | import { ActivityFollow } from '../../../../shared/models/activitypub' |
3 | import { AccountInstance } from '../../../models' | 3 | import { AccountModel } from '../../../models/account/account' |
4 | import { AccountFollowInstance } from '../../../models/account/account-follow-interface' | 4 | import { AccountFollowModel } from '../../../models/account/account-follow' |
5 | import { getAccountFollowActivityPubUrl } from '../url' | 5 | import { getAccountFollowActivityPubUrl } from '../url' |
6 | import { unicastTo } from './misc' | 6 | import { unicastTo } from './misc' |
7 | 7 | ||
8 | function sendFollow (accountFollow: AccountFollowInstance, t: Transaction) { | 8 | function sendFollow (accountFollow: AccountFollowModel, t: Transaction) { |
9 | const me = accountFollow.AccountFollower | 9 | const me = accountFollow.AccountFollower |
10 | const following = accountFollow.AccountFollowing | 10 | const following = accountFollow.AccountFollowing |
11 | 11 | ||
@@ -15,15 +15,13 @@ function sendFollow (accountFollow: AccountFollowInstance, t: Transaction) { | |||
15 | return unicastTo(data, me, following.inboxUrl, t) | 15 | return unicastTo(data, me, following.inboxUrl, t) |
16 | } | 16 | } |
17 | 17 | ||
18 | function followActivityData (url: string, byAccount: AccountInstance, targetAccount: AccountInstance) { | 18 | function followActivityData (url: string, byAccount: AccountModel, targetAccount: AccountModel): ActivityFollow { |
19 | const activity: ActivityFollow = { | 19 | return { |
20 | type: 'Follow', | 20 | type: 'Follow', |
21 | id: url, | 21 | id: url, |
22 | actor: byAccount.url, | 22 | actor: byAccount.url, |
23 | object: targetAccount.url | 23 | object: targetAccount.url |
24 | } | 24 | } |
25 | |||
26 | return activity | ||
27 | } | 25 | } |
28 | 26 | ||
29 | // --------------------------------------------------------------------------- | 27 | // --------------------------------------------------------------------------- |