diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-04 16:56:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-04 16:56:36 +0100 |
commit | c3badc81fe3d78601fb278a7f28eeed63060d300 (patch) | |
tree | e060a547202d6a3422dc738c6cb02fb5c15f141f /server/lib/activitypub/process | |
parent | bb82394c0d41cc939a35782e50ce908c92e3ecfe (diff) | |
download | PeerTube-c3badc81fe3d78601fb278a7f28eeed63060d300.tar.gz PeerTube-c3badc81fe3d78601fb278a7f28eeed63060d300.tar.zst PeerTube-c3badc81fe3d78601fb278a7f28eeed63060d300.zip |
Fix delete activities
Diffstat (limited to 'server/lib/activitypub/process')
-rw-r--r-- | server/lib/activitypub/process/process-delete.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/process/process-delete.ts b/server/lib/activitypub/process/process-delete.ts index 604570e74..01751422d 100644 --- a/server/lib/activitypub/process/process-delete.ts +++ b/server/lib/activitypub/process/process-delete.ts | |||
@@ -12,7 +12,7 @@ import { getOrCreateActorAndServerAndModel } from '../actor' | |||
12 | async function processDeleteActivity (activity: ActivityDelete) { | 12 | async function processDeleteActivity (activity: ActivityDelete) { |
13 | const actor = await getOrCreateActorAndServerAndModel(activity.actor) | 13 | const actor = await getOrCreateActorAndServerAndModel(activity.actor) |
14 | 14 | ||
15 | if (actor.url === activity.id) { | 15 | if (actor.url === activity.object) { |
16 | if (actor.type === 'Person') { | 16 | if (actor.type === 'Person') { |
17 | if (!actor.Account) throw new Error('Actor ' + actor.url + ' is a person but we cannot find it in database.') | 17 | if (!actor.Account) throw new Error('Actor ' + actor.url + ' is a person but we cannot find it in database.') |
18 | 18 | ||
@@ -25,14 +25,14 @@ async function processDeleteActivity (activity: ActivityDelete) { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | { | 27 | { |
28 | const videoCommentInstance = await VideoCommentModel.loadByUrlAndPopulateAccount(activity.id) | 28 | const videoCommentInstance = await VideoCommentModel.loadByUrlAndPopulateAccount(activity.object) |
29 | if (videoCommentInstance) { | 29 | if (videoCommentInstance) { |
30 | return processDeleteVideoComment(actor, videoCommentInstance) | 30 | return processDeleteVideoComment(actor, videoCommentInstance) |
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||
34 | { | 34 | { |
35 | const videoInstance = await VideoModel.loadByUrlAndPopulateAccount(activity.id) | 35 | const videoInstance = await VideoModel.loadByUrlAndPopulateAccount(activity.object) |
36 | if (videoInstance) { | 36 | if (videoInstance) { |
37 | return processDeleteVideo(actor, videoInstance) | 37 | return processDeleteVideo(actor, videoInstance) |
38 | } | 38 | } |