diff options
Diffstat (limited to 'server/lib/activitypub/send/send-like.ts')
-rw-r--r-- | server/lib/activitypub/send/send-like.ts | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/server/lib/activitypub/send/send-like.ts b/server/lib/activitypub/send/send-like.ts index b01249e69..fb2b4aaf8 100644 --- a/server/lib/activitypub/send/send-like.ts +++ b/server/lib/activitypub/send/send-like.ts | |||
@@ -13,20 +13,20 @@ import { | |||
13 | unicastTo | 13 | unicastTo |
14 | } from './misc' | 14 | } from './misc' |
15 | 15 | ||
16 | async function sendLikeToOrigin (byActor: ActorModel, video: VideoModel, t: Transaction) { | 16 | async function sendLike (byActor: ActorModel, video: VideoModel, t: Transaction) { |
17 | const url = getVideoLikeActivityPubUrl(byActor, video) | 17 | const url = getVideoLikeActivityPubUrl(byActor, video) |
18 | 18 | ||
19 | const accountsInvolvedInVideo = await getActorsInvolvedInVideo(video, t) | 19 | const accountsInvolvedInVideo = await getActorsInvolvedInVideo(video, t) |
20 | const audience = getOriginVideoAudience(video, accountsInvolvedInVideo) | ||
21 | const data = await likeActivityData(url, byActor, video, t, audience) | ||
22 | 20 | ||
23 | return unicastTo(data, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl) | 21 | // Send to origin |
24 | } | 22 | if (video.isOwned() === false) { |
23 | const audience = getOriginVideoAudience(video, accountsInvolvedInVideo) | ||
24 | const data = await likeActivityData(url, byActor, video, t, audience) | ||
25 | 25 | ||
26 | async function sendLikeToVideoFollowers (byActor: ActorModel, video: VideoModel, t: Transaction) { | 26 | return unicastTo(data, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl) |
27 | const url = getVideoLikeActivityPubUrl(byActor, video) | 27 | } |
28 | 28 | ||
29 | const accountsInvolvedInVideo = await getActorsInvolvedInVideo(video, t) | 29 | // Send to followers |
30 | const audience = getObjectFollowersAudience(accountsInvolvedInVideo) | 30 | const audience = getObjectFollowersAudience(accountsInvolvedInVideo) |
31 | const data = await likeActivityData(url, byActor, video, t, audience) | 31 | const data = await likeActivityData(url, byActor, video, t, audience) |
32 | 32 | ||
@@ -56,7 +56,6 @@ async function likeActivityData ( | |||
56 | // --------------------------------------------------------------------------- | 56 | // --------------------------------------------------------------------------- |
57 | 57 | ||
58 | export { | 58 | export { |
59 | sendLikeToOrigin, | 59 | sendLike, |
60 | sendLikeToVideoFollowers, | ||
61 | likeActivityData | 60 | likeActivityData |
62 | } | 61 | } |