aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/videos.ts')
-rw-r--r--server/lib/activitypub/videos.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts
index c38edad56..c29bcc528 100644
--- a/server/lib/activitypub/videos.ts
+++ b/server/lib/activitypub/videos.ts
@@ -336,10 +336,15 @@ async function updateVideoFromAP (options: {
336 336
337 videoFieldsSave = video.toJSON() 337 videoFieldsSave = video.toJSON()
338 338
339 // Check actor has the right to update the video 339 // Check we can update the channel: we trust the remote server
340 const videoChannel = video.VideoChannel 340 const oldVideoChannel = video.VideoChannel
341 if (videoChannel.Account.id !== account.id) { 341
342 throw new Error('Account ' + account.Actor.url + ' does not own video channel ' + videoChannel.Actor.url) 342 if (!oldVideoChannel.Actor.serverId || !channel.Actor.serverId) {
343 throw new Error('Cannot check old channel/new channel validity because `serverId` is null')
344 }
345
346 if (oldVideoChannel.Actor.serverId !== channel.Actor.serverId) {
347 throw new Error('New channel ' + channel.Actor.url + ' is not on the same server than new channel ' + oldVideoChannel.Actor.url)
343 } 348 }
344 349
345 const to = overrideTo || videoObject.to 350 const to = overrideTo || videoObject.to