From 25ed141c7c7631ef21d8764c1163fbf8a6591391 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Nov 2017 11:31:15 +0100 Subject: Put activity pub sends inside transactions --- server/lib/activitypub/send/send-delete.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/lib/activitypub/send/send-delete.ts') diff --git a/server/lib/activitypub/send/send-delete.ts b/server/lib/activitypub/send/send-delete.ts index 5be0e2d24..c49cda04f 100644 --- a/server/lib/activitypub/send/send-delete.ts +++ b/server/lib/activitypub/send/send-delete.ts @@ -7,9 +7,9 @@ import { broadcastToFollowers } from './misc' async function sendDeleteVideoChannel (videoChannel: VideoChannelInstance, t: Transaction) { const byAccount = videoChannel.Account - const data = await deleteActivityData(videoChannel.url, byAccount) + const data = deleteActivityData(videoChannel.url, byAccount) - const accountsInvolved = await db.VideoChannelShare.loadAccountsByShare(videoChannel.id) + const accountsInvolved = await db.VideoChannelShare.loadAccountsByShare(videoChannel.id, t) accountsInvolved.push(byAccount) return broadcastToFollowers(data, byAccount, accountsInvolved, t) @@ -18,9 +18,9 @@ async function sendDeleteVideoChannel (videoChannel: VideoChannelInstance, t: Tr async function sendDeleteVideo (video: VideoInstance, t: Transaction) { const byAccount = video.VideoChannel.Account - const data = await deleteActivityData(video.url, byAccount) + const data = deleteActivityData(video.url, byAccount) - const accountsInvolved = await db.VideoShare.loadAccountsByShare(video.id) + const accountsInvolved = await db.VideoShare.loadAccountsByShare(video.id, t) accountsInvolved.push(byAccount) return broadcastToFollowers(data, byAccount, accountsInvolved, t) @@ -42,7 +42,7 @@ export { // --------------------------------------------------------------------------- -async function deleteActivityData (url: string, byAccount: AccountInstance) { +function deleteActivityData (url: string, byAccount: AccountInstance) { const activity: ActivityDelete = { type: 'Delete', id: url, -- cgit v1.2.3