diff options
Diffstat (limited to 'server/lib/activitypub/process')
-rw-r--r-- | server/lib/activitypub/process/process-announce.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 9 |
2 files changed, 4 insertions, 9 deletions
diff --git a/server/lib/activitypub/process/process-announce.ts b/server/lib/activitypub/process/process-announce.ts index d8ca59425..b08156aa1 100644 --- a/server/lib/activitypub/process/process-announce.ts +++ b/server/lib/activitypub/process/process-announce.ts | |||
@@ -24,10 +24,8 @@ export { | |||
24 | 24 | ||
25 | async function processVideoShare (actorAnnouncer: ActorModel, activity: ActivityAnnounce) { | 25 | async function processVideoShare (actorAnnouncer: ActorModel, activity: ActivityAnnounce) { |
26 | const objectUri = typeof activity.object === 'string' ? activity.object : activity.object.id | 26 | const objectUri = typeof activity.object === 'string' ? activity.object : activity.object.id |
27 | let video: VideoModel | ||
28 | 27 | ||
29 | const res = await getOrCreateAccountAndVideoAndChannel(objectUri) | 28 | const { video } = await getOrCreateAccountAndVideoAndChannel(objectUri) |
30 | video = res.video | ||
31 | 29 | ||
32 | return sequelizeTypescript.transaction(async t => { | 30 | return sequelizeTypescript.transaction(async t => { |
33 | // Add share entry | 31 | // Add share entry |
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 791148919..9655d015f 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -23,7 +23,7 @@ async function processCreateActivity (activity: ActivityCreate) { | |||
23 | } else if (activityType === 'Dislike') { | 23 | } else if (activityType === 'Dislike') { |
24 | return retryTransactionWrapper(processCreateDislike, actor, activity) | 24 | return retryTransactionWrapper(processCreateDislike, actor, activity) |
25 | } else if (activityType === 'Video') { | 25 | } else if (activityType === 'Video') { |
26 | return processCreateVideo(actor, activity) | 26 | return processCreateVideo(activity) |
27 | } else if (activityType === 'Flag') { | 27 | } else if (activityType === 'Flag') { |
28 | return retryTransactionWrapper(processCreateVideoAbuse, actor, activityObject as VideoAbuseObject) | 28 | return retryTransactionWrapper(processCreateVideoAbuse, actor, activityObject as VideoAbuseObject) |
29 | } else if (activityType === 'Note') { | 29 | } else if (activityType === 'Note') { |
@@ -42,13 +42,10 @@ export { | |||
42 | 42 | ||
43 | // --------------------------------------------------------------------------- | 43 | // --------------------------------------------------------------------------- |
44 | 44 | ||
45 | async function processCreateVideo ( | 45 | async function processCreateVideo (activity: ActivityCreate) { |
46 | actor: ActorModel, | ||
47 | activity: ActivityCreate | ||
48 | ) { | ||
49 | const videoToCreateData = activity.object as VideoTorrentObject | 46 | const videoToCreateData = activity.object as VideoTorrentObject |
50 | 47 | ||
51 | const { video } = await getOrCreateAccountAndVideoAndChannel(videoToCreateData, actor) | 48 | const { video } = await getOrCreateAccountAndVideoAndChannel(videoToCreateData) |
52 | 49 | ||
53 | return video | 50 | return video |
54 | } | 51 | } |