aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/process/process-create.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/process/process-create.ts')
-rw-r--r--server/lib/activitypub/process/process-create.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts
index 1f982598b..c88082bbf 100644
--- a/server/lib/activitypub/process/process-create.ts
+++ b/server/lib/activitypub/process/process-create.ts
@@ -8,7 +8,7 @@ import { AccountInstance } from '../../../models/account/account-interface'
8import { getOrCreateAccountAndServer } from '../account' 8import { getOrCreateAccountAndServer } from '../account'
9import { forwardActivity } from '../send/misc' 9import { forwardActivity } from '../send/misc'
10import { getVideoChannelActivityPubUrl } from '../url' 10import { getVideoChannelActivityPubUrl } from '../url'
11import { videoChannelActivityObjectToDBAttributes } from './misc' 11import { addVideoChannelShares, videoChannelActivityObjectToDBAttributes } from './misc'
12 12
13async function processCreateActivity (activity: ActivityCreate) { 13async function processCreateActivity (activity: ActivityCreate) {
14 const activityObject = activity.object 14 const activityObject = activity.object
@@ -92,13 +92,19 @@ async function processCreateView (byAccount: AccountInstance, activity: Activity
92 } 92 }
93} 93}
94 94
95function processCreateVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) { 95async function processCreateVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) {
96 const options = { 96 const options = {
97 arguments: [ account, videoChannelToCreateData ], 97 arguments: [ account, videoChannelToCreateData ],
98 errorMessage: 'Cannot insert the remote video channel with many retries.' 98 errorMessage: 'Cannot insert the remote video channel with many retries.'
99 } 99 }
100 100
101 return retryTransactionWrapper(addRemoteVideoChannel, options) 101 const videoChannel = await retryTransactionWrapper(addRemoteVideoChannel, options)
102
103 if (videoChannelToCreateData.shares && Array.isArray(videoChannelToCreateData.shares.orderedItems)) {
104 await addVideoChannelShares(videoChannel, videoChannelToCreateData.shares.orderedItems)
105 }
106
107 return videoChannel
102} 108}
103 109
104function addRemoteVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) { 110function addRemoteVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) {