aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/process-create.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-15 17:56:21 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:52 +0100
commitd846501818c2d29e66e6fd141789cb04fd55a437 (patch)
tree9b807a84459edd400fd36325c49c4adfbd6c4fd2 /server/lib/activitypub/process-create.ts
parent8e10cf1a5a438a00e5f7e0691cb830769867cffc (diff)
downloadPeerTube-d846501818c2d29e66e6fd141789cb04fd55a437.tar.gz
PeerTube-d846501818c2d29e66e6fd141789cb04fd55a437.tar.zst
PeerTube-d846501818c2d29e66e6fd141789cb04fd55a437.zip
Handle announces in inbox
Diffstat (limited to 'server/lib/activitypub/process-create.ts')
-rw-r--r--server/lib/activitypub/process-create.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/lib/activitypub/process-create.ts b/server/lib/activitypub/process-create.ts
index 8d842b822..1b825ebbc 100644
--- a/server/lib/activitypub/process-create.ts
+++ b/server/lib/activitypub/process-create.ts
@@ -40,7 +40,7 @@ function processCreateVideoChannel (account: AccountInstance, videoChannelToCrea
40async function addRemoteVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) { 40async function addRemoteVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) {
41 logger.debug('Adding remote video channel "%s".', videoChannelToCreateData.uuid) 41 logger.debug('Adding remote video channel "%s".', videoChannelToCreateData.uuid)
42 42
43 await db.sequelize.transaction(async t => { 43 return db.sequelize.transaction(async t => {
44 let videoChannel = await db.VideoChannel.loadByUUIDOrUrl(videoChannelToCreateData.uuid, videoChannelToCreateData.id, t) 44 let videoChannel = await db.VideoChannel.loadByUUIDOrUrl(videoChannelToCreateData.uuid, videoChannelToCreateData.id, t)
45 if (videoChannel) throw new Error('Video channel with this URL/UUID already exists.') 45 if (videoChannel) throw new Error('Video channel with this URL/UUID already exists.')
46 46
@@ -57,10 +57,11 @@ async function addRemoteVideoChannel (account: AccountInstance, videoChannelToCr
57 videoChannel = db.VideoChannel.build(videoChannelData) 57 videoChannel = db.VideoChannel.build(videoChannelData)
58 videoChannel.url = getActivityPubUrl('videoChannel', videoChannel.uuid) 58 videoChannel.url = getActivityPubUrl('videoChannel', videoChannel.uuid)
59 59
60 await videoChannel.save({ transaction: t }) 60 videoChannel = await videoChannel.save({ transaction: t })
61 }) 61 logger.info('Remote video channel with uuid %s inserted.', videoChannelToCreateData.uuid)
62 62
63 logger.info('Remote video channel with uuid %s inserted.', videoChannelToCreateData.uuid) 63 return videoChannel
64 })
64} 65}
65 66
66function processCreateVideoAbuse (account: AccountInstance, videoAbuseToCreateData: VideoAbuseObject) { 67function processCreateVideoAbuse (account: AccountInstance, videoAbuseToCreateData: VideoAbuseObject) {