aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/send/send-delete.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-30 11:31:15 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-30 11:31:15 +0100
commit25ed141c7c7631ef21d8764c1163fbf8a6591391 (patch)
tree8f556181a3369e7e4938d612d91be0af813e5067 /server/lib/activitypub/send/send-delete.ts
parent5cd80545422bba855cc9a730a2e13cc9d982c34b (diff)
downloadPeerTube-25ed141c7c7631ef21d8764c1163fbf8a6591391.tar.gz
PeerTube-25ed141c7c7631ef21d8764c1163fbf8a6591391.tar.zst
PeerTube-25ed141c7c7631ef21d8764c1163fbf8a6591391.zip
Put activity pub sends inside transactions
Diffstat (limited to 'server/lib/activitypub/send/send-delete.ts')
-rw-r--r--server/lib/activitypub/send/send-delete.ts10
1 files changed, 5 insertions, 5 deletions
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'
7async function sendDeleteVideoChannel (videoChannel: VideoChannelInstance, t: Transaction) { 7async function sendDeleteVideoChannel (videoChannel: VideoChannelInstance, t: Transaction) {
8 const byAccount = videoChannel.Account 8 const byAccount = videoChannel.Account
9 9
10 const data = await deleteActivityData(videoChannel.url, byAccount) 10 const data = deleteActivityData(videoChannel.url, byAccount)
11 11
12 const accountsInvolved = await db.VideoChannelShare.loadAccountsByShare(videoChannel.id) 12 const accountsInvolved = await db.VideoChannelShare.loadAccountsByShare(videoChannel.id, t)
13 accountsInvolved.push(byAccount) 13 accountsInvolved.push(byAccount)
14 14
15 return broadcastToFollowers(data, byAccount, accountsInvolved, t) 15 return broadcastToFollowers(data, byAccount, accountsInvolved, t)
@@ -18,9 +18,9 @@ async function sendDeleteVideoChannel (videoChannel: VideoChannelInstance, t: Tr
18async function sendDeleteVideo (video: VideoInstance, t: Transaction) { 18async function sendDeleteVideo (video: VideoInstance, t: Transaction) {
19 const byAccount = video.VideoChannel.Account 19 const byAccount = video.VideoChannel.Account
20 20
21 const data = await deleteActivityData(video.url, byAccount) 21 const data = deleteActivityData(video.url, byAccount)
22 22
23 const accountsInvolved = await db.VideoShare.loadAccountsByShare(video.id) 23 const accountsInvolved = await db.VideoShare.loadAccountsByShare(video.id, t)
24 accountsInvolved.push(byAccount) 24 accountsInvolved.push(byAccount)
25 25
26 return broadcastToFollowers(data, byAccount, accountsInvolved, t) 26 return broadcastToFollowers(data, byAccount, accountsInvolved, t)
@@ -42,7 +42,7 @@ export {
42 42
43// --------------------------------------------------------------------------- 43// ---------------------------------------------------------------------------
44 44
45async function deleteActivityData (url: string, byAccount: AccountInstance) { 45function deleteActivityData (url: string, byAccount: AccountInstance) {
46 const activity: ActivityDelete = { 46 const activity: ActivityDelete = {
47 type: 'Delete', 47 type: 'Delete',
48 id: url, 48 id: url,