From d846501818c2d29e66e6fd141789cb04fd55a437 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Nov 2017 17:56:21 +0100 Subject: Handle announces in inbox --- server/lib/activitypub/process-create.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'server/lib/activitypub/process-create.ts') 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 async function addRemoteVideoChannel (account: AccountInstance, videoChannelToCreateData: VideoChannelObject) { logger.debug('Adding remote video channel "%s".', videoChannelToCreateData.uuid) - await db.sequelize.transaction(async t => { + return db.sequelize.transaction(async t => { let videoChannel = await db.VideoChannel.loadByUUIDOrUrl(videoChannelToCreateData.uuid, videoChannelToCreateData.id, t) if (videoChannel) throw new Error('Video channel with this URL/UUID already exists.') @@ -57,10 +57,11 @@ async function addRemoteVideoChannel (account: AccountInstance, videoChannelToCr videoChannel = db.VideoChannel.build(videoChannelData) videoChannel.url = getActivityPubUrl('videoChannel', videoChannel.uuid) - await videoChannel.save({ transaction: t }) - }) + videoChannel = await videoChannel.save({ transaction: t }) + logger.info('Remote video channel with uuid %s inserted.', videoChannelToCreateData.uuid) - logger.info('Remote video channel with uuid %s inserted.', videoChannelToCreateData.uuid) + return videoChannel + }) } function processCreateVideoAbuse (account: AccountInstance, videoAbuseToCreateData: VideoAbuseObject) { -- cgit v1.2.3