diff options
Diffstat (limited to 'server/lib/activitypub/process/process-create.ts')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 12 |
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' | |||
8 | import { getOrCreateAccountAndServer } from '../account' | 8 | import { getOrCreateAccountAndServer } from '../account' |
9 | import { forwardActivity } from '../send/misc' | 9 | import { forwardActivity } from '../send/misc' |
10 | import { getVideoChannelActivityPubUrl } from '../url' | 10 | import { getVideoChannelActivityPubUrl } from '../url' |
11 | import { videoChannelActivityObjectToDBAttributes } from './misc' | 11 | import { addVideoChannelShares, videoChannelActivityObjectToDBAttributes } from './misc' |
12 | 12 | ||
13 | async function processCreateActivity (activity: ActivityCreate) { | 13 | async 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 | ||
95 | function processCreateVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) { | 95 | async 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 | ||
104 | function addRemoteVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) { | 110 | function addRemoteVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) { |