diff options
Diffstat (limited to 'server/lib/activitypub/send/send-add.ts')
-rw-r--r-- | server/lib/activitypub/send/send-add.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/server/lib/activitypub/send/send-add.ts b/server/lib/activitypub/send/send-add.ts index d8ac2853e..fd614db75 100644 --- a/server/lib/activitypub/send/send-add.ts +++ b/server/lib/activitypub/send/send-add.ts | |||
@@ -1,10 +1,11 @@ | |||
1 | import { Transaction } from 'sequelize' | 1 | import { Transaction } from 'sequelize' |
2 | import { ActivityAdd } from '../../../../shared/models/activitypub/activity' | 2 | import { ActivityAdd } from '../../../../shared/models/activitypub' |
3 | import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' | 3 | import { VideoPrivacy } from '../../../../shared/models/videos' |
4 | import { AccountInstance, VideoInstance } from '../../../models' | 4 | import { AccountModel } from '../../../models/account/account' |
5 | import { VideoModel } from '../../../models/video/video' | ||
5 | import { broadcastToFollowers, getAudience } from './misc' | 6 | import { broadcastToFollowers, getAudience } from './misc' |
6 | 7 | ||
7 | async function sendAddVideo (video: VideoInstance, t: Transaction) { | 8 | async function sendAddVideo (video: VideoModel, t: Transaction) { |
8 | const byAccount = video.VideoChannel.Account | 9 | const byAccount = video.VideoChannel.Account |
9 | 10 | ||
10 | const videoObject = video.toActivityPubObject() | 11 | const videoObject = video.toActivityPubObject() |
@@ -15,16 +16,17 @@ async function sendAddVideo (video: VideoInstance, t: Transaction) { | |||
15 | 16 | ||
16 | async function addActivityData ( | 17 | async function addActivityData ( |
17 | url: string, | 18 | url: string, |
18 | byAccount: AccountInstance, | 19 | byAccount: AccountModel, |
19 | video: VideoInstance, | 20 | video: VideoModel, |
20 | target: string, | 21 | target: string, |
21 | object: any, | 22 | object: any, |
22 | t: Transaction | 23 | t: Transaction |
23 | ) { | 24 | ): Promise<ActivityAdd> { |
24 | const videoPublic = video.privacy === VideoPrivacy.PUBLIC | 25 | const videoPublic = video.privacy === VideoPrivacy.PUBLIC |
25 | 26 | ||
26 | const { to, cc } = await getAudience(byAccount, t, videoPublic) | 27 | const { to, cc } = await getAudience(byAccount, t, videoPublic) |
27 | const activity: ActivityAdd = { | 28 | |
29 | return { | ||
28 | type: 'Add', | 30 | type: 'Add', |
29 | id: url, | 31 | id: url, |
30 | actor: byAccount.url, | 32 | actor: byAccount.url, |
@@ -33,8 +35,6 @@ async function addActivityData ( | |||
33 | object, | 35 | object, |
34 | target | 36 | target |
35 | } | 37 | } |
36 | |||
37 | return activity | ||
38 | } | 38 | } |
39 | 39 | ||
40 | // --------------------------------------------------------------------------- | 40 | // --------------------------------------------------------------------------- |