aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/lib/activitypub/send/send-undo.ts17
-rw-r--r--server/tests/api/video-transcoder.ts2
2 files changed, 15 insertions, 4 deletions
diff --git a/server/lib/activitypub/send/send-undo.ts b/server/lib/activitypub/send/send-undo.ts
index 9b732df40..878acd21e 100644
--- a/server/lib/activitypub/send/send-undo.ts
+++ b/server/lib/activitypub/send/send-undo.ts
@@ -10,7 +10,14 @@ import { AccountInstance } from '../../../models'
10import { AccountFollowInstance } from '../../../models/account/account-follow-interface' 10import { AccountFollowInstance } from '../../../models/account/account-follow-interface'
11import { VideoInstance } from '../../../models/video/video-interface' 11import { VideoInstance } from '../../../models/video/video-interface'
12import { getAccountFollowActivityPubUrl, getUndoActivityPubUrl, getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from '../url' 12import { getAccountFollowActivityPubUrl, getUndoActivityPubUrl, getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from '../url'
13import { broadcastToFollowers, getAccountsInvolvedInVideo, getAudience, getObjectFollowersAudience, unicastTo } from './misc' 13import {
14 broadcastToFollowers,
15 getAccountsInvolvedInVideo,
16 getAudience,
17 getObjectFollowersAudience,
18 getOriginVideoAudience,
19 unicastTo
20} from './misc'
14import { createActivityData, createDislikeActivityData } from './send-create' 21import { createActivityData, createDislikeActivityData } from './send-create'
15import { followActivityData } from './send-follow' 22import { followActivityData } from './send-follow'
16import { likeActivityData } from './send-like' 23import { likeActivityData } from './send-like'
@@ -32,8 +39,10 @@ async function sendUndoLikeToOrigin (byAccount: AccountInstance, video: VideoIns
32 const likeUrl = getVideoLikeActivityPubUrl(byAccount, video) 39 const likeUrl = getVideoLikeActivityPubUrl(byAccount, video)
33 const undoUrl = getUndoActivityPubUrl(likeUrl) 40 const undoUrl = getUndoActivityPubUrl(likeUrl)
34 41
42 const accountsInvolvedInVideo = await getAccountsInvolvedInVideo(video)
43 const audience = getOriginVideoAudience(video, accountsInvolvedInVideo)
35 const object = await likeActivityData(likeUrl, byAccount, video) 44 const object = await likeActivityData(likeUrl, byAccount, video)
36 const data = await undoActivityData(undoUrl, byAccount, object) 45 const data = await undoActivityData(undoUrl, byAccount, object, audience)
37 46
38 return unicastTo(data, byAccount, video.VideoChannel.Account.sharedInboxUrl, t) 47 return unicastTo(data, byAccount, video.VideoChannel.Account.sharedInboxUrl, t)
39} 48}
@@ -55,8 +64,10 @@ async function sendUndoDislikeToOrigin (byAccount: AccountInstance, video: Video
55 const dislikeUrl = getVideoDislikeActivityPubUrl(byAccount, video) 64 const dislikeUrl = getVideoDislikeActivityPubUrl(byAccount, video)
56 const undoUrl = getUndoActivityPubUrl(dislikeUrl) 65 const undoUrl = getUndoActivityPubUrl(dislikeUrl)
57 66
67 const accountsInvolvedInVideo = await getAccountsInvolvedInVideo(video)
68 const audience = getOriginVideoAudience(video, accountsInvolvedInVideo)
58 const dislikeActivity = createDislikeActivityData(byAccount, video) 69 const dislikeActivity = createDislikeActivityData(byAccount, video)
59 const object = await createActivityData(undoUrl, byAccount, dislikeActivity) 70 const object = await createActivityData(undoUrl, byAccount, dislikeActivity, audience)
60 71
61 const data = await undoActivityData(undoUrl, byAccount, object) 72 const data = await undoActivityData(undoUrl, byAccount, object)
62 73
diff --git a/server/tests/api/video-transcoder.ts b/server/tests/api/video-transcoder.ts
index 95d48342f..9a6e91b76 100644
--- a/server/tests/api/video-transcoder.ts
+++ b/server/tests/api/video-transcoder.ts
@@ -67,7 +67,7 @@ describe('Test video transcoding', function () {
67 } 67 }
68 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes) 68 await uploadVideo(servers[1].url, servers[1].accessToken, videoAttributes)
69 69
70 await wait(10000) 70 await wait(20000)
71 71
72 const res = await getVideosList(servers[1].url) 72 const res = await getVideosList(servers[1].url)
73 73