diff options
Diffstat (limited to 'server/lib/activitypub/send-request.ts')
-rw-r--r-- | server/lib/activitypub/send-request.ts | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/server/lib/activitypub/send-request.ts b/server/lib/activitypub/send-request.ts index f9b72f2a8..d5d07011a 100644 --- a/server/lib/activitypub/send-request.ts +++ b/server/lib/activitypub/send-request.ts | |||
@@ -24,13 +24,19 @@ async function sendUpdateVideoChannel (videoChannel: VideoChannelInstance, t: Se | |||
24 | const videoChannelObject = videoChannel.toActivityPubObject() | 24 | const videoChannelObject = videoChannel.toActivityPubObject() |
25 | const data = await updateActivityData(videoChannel.url, videoChannel.Account, videoChannelObject) | 25 | const data = await updateActivityData(videoChannel.url, videoChannel.Account, videoChannelObject) |
26 | 26 | ||
27 | return broadcastToFollowers(data, [ videoChannel.Account ], t) | 27 | const accountsInvolved = await db.VideoChannelShare.loadAccountsByShare(videoChannel.id) |
28 | accountsInvolved.push(videoChannel.Account) | ||
29 | |||
30 | return broadcastToFollowers(data, accountsInvolved, t) | ||
28 | } | 31 | } |
29 | 32 | ||
30 | async function sendDeleteVideoChannel (videoChannel: VideoChannelInstance, t: Sequelize.Transaction) { | 33 | async function sendDeleteVideoChannel (videoChannel: VideoChannelInstance, t: Sequelize.Transaction) { |
31 | const data = await deleteActivityData(videoChannel.url, videoChannel.Account) | 34 | const data = await deleteActivityData(videoChannel.url, videoChannel.Account) |
32 | 35 | ||
33 | return broadcastToFollowers(data, [ videoChannel.Account ], t) | 36 | const accountsInvolved = await db.VideoChannelShare.loadAccountsByShare(videoChannel.id) |
37 | accountsInvolved.push(videoChannel.Account) | ||
38 | |||
39 | return broadcastToFollowers(data, accountsInvolved, t) | ||
34 | } | 40 | } |
35 | 41 | ||
36 | async function sendAddVideo (video: VideoInstance, t: Sequelize.Transaction) { | 42 | async function sendAddVideo (video: VideoInstance, t: Sequelize.Transaction) { |
@@ -44,13 +50,19 @@ async function sendUpdateVideo (video: VideoInstance, t: Sequelize.Transaction) | |||
44 | const videoObject = video.toActivityPubObject() | 50 | const videoObject = video.toActivityPubObject() |
45 | const data = await updateActivityData(video.url, video.VideoChannel.Account, videoObject) | 51 | const data = await updateActivityData(video.url, video.VideoChannel.Account, videoObject) |
46 | 52 | ||
47 | return broadcastToFollowers(data, [ video.VideoChannel.Account ], t) | 53 | const accountsInvolved = await db.VideoShare.loadAccountsByShare(video.id) |
54 | accountsInvolved.push(video.VideoChannel.Account) | ||
55 | |||
56 | return broadcastToFollowers(data, accountsInvolved, t) | ||
48 | } | 57 | } |
49 | 58 | ||
50 | async function sendDeleteVideo (video: VideoInstance, t: Sequelize.Transaction) { | 59 | async function sendDeleteVideo (video: VideoInstance, t: Sequelize.Transaction) { |
51 | const data = await deleteActivityData(video.url, video.VideoChannel.Account) | 60 | const data = await deleteActivityData(video.url, video.VideoChannel.Account) |
52 | 61 | ||
53 | return broadcastToFollowers(data, [ video.VideoChannel.Account ], t) | 62 | const accountsInvolved = await db.VideoShare.loadAccountsByShare(video.id) |
63 | accountsInvolved.push(video.VideoChannel.Account) | ||
64 | |||
65 | return broadcastToFollowers(data, accountsInvolved, t) | ||
54 | } | 66 | } |
55 | 67 | ||
56 | async function sendDeleteAccount (account: AccountInstance, t: Sequelize.Transaction) { | 68 | async function sendDeleteAccount (account: AccountInstance, t: Sequelize.Transaction) { |