aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/send/send-add.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/send/send-add.ts')
-rw-r--r--server/lib/activitypub/send/send-add.ts20
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 @@
1import { Transaction } from 'sequelize' 1import { Transaction } from 'sequelize'
2import { ActivityAdd } from '../../../../shared/models/activitypub/activity' 2import { ActivityAdd } from '../../../../shared/models/activitypub'
3import { VideoPrivacy } from '../../../../shared/models/videos/video-privacy.enum' 3import { VideoPrivacy } from '../../../../shared/models/videos'
4import { AccountInstance, VideoInstance } from '../../../models' 4import { AccountModel } from '../../../models/account/account'
5import { VideoModel } from '../../../models/video/video'
5import { broadcastToFollowers, getAudience } from './misc' 6import { broadcastToFollowers, getAudience } from './misc'
6 7
7async function sendAddVideo (video: VideoInstance, t: Transaction) { 8async 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
16async function addActivityData ( 17async 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// ---------------------------------------------------------------------------