aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/process/process-create.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/activitypub/process/process-create.ts')
-rw-r--r--server/lib/activitypub/process/process-create.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts
index 9655d015f..e8f5ade06 100644
--- a/server/lib/activitypub/process/process-create.ts
+++ b/server/lib/activitypub/process/process-create.ts
@@ -10,7 +10,7 @@ import { VideoAbuseModel } from '../../../models/video/video-abuse'
10import { VideoCommentModel } from '../../../models/video/video-comment' 10import { VideoCommentModel } from '../../../models/video/video-comment'
11import { getOrCreateActorAndServerAndModel } from '../actor' 11import { getOrCreateActorAndServerAndModel } from '../actor'
12import { resolveThread } from '../video-comments' 12import { resolveThread } from '../video-comments'
13import { getOrCreateAccountAndVideoAndChannel } from '../videos' 13import { getOrCreateVideoAndAccountAndChannel } from '../videos'
14import { forwardActivity, forwardVideoRelatedActivity } from '../send/utils' 14import { forwardActivity, forwardVideoRelatedActivity } from '../send/utils'
15 15
16async function processCreateActivity (activity: ActivityCreate) { 16async function processCreateActivity (activity: ActivityCreate) {
@@ -45,7 +45,7 @@ export {
45async function processCreateVideo (activity: ActivityCreate) { 45async function processCreateVideo (activity: ActivityCreate) {
46 const videoToCreateData = activity.object as VideoTorrentObject 46 const videoToCreateData = activity.object as VideoTorrentObject
47 47
48 const { video } = await getOrCreateAccountAndVideoAndChannel(videoToCreateData) 48 const { video } = await getOrCreateVideoAndAccountAndChannel(videoToCreateData)
49 49
50 return video 50 return video
51} 51}
@@ -56,7 +56,7 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea
56 56
57 if (!byAccount) throw new Error('Cannot create dislike with the non account actor ' + byActor.url) 57 if (!byAccount) throw new Error('Cannot create dislike with the non account actor ' + byActor.url)
58 58
59 const { video } = await getOrCreateAccountAndVideoAndChannel(dislike.object) 59 const { video } = await getOrCreateVideoAndAccountAndChannel(dislike.object)
60 60
61 return sequelizeTypescript.transaction(async t => { 61 return sequelizeTypescript.transaction(async t => {
62 const rate = { 62 const rate = {
@@ -83,7 +83,7 @@ async function processCreateDislike (byActor: ActorModel, activity: ActivityCrea
83async function processCreateView (byActor: ActorModel, activity: ActivityCreate) { 83async function processCreateView (byActor: ActorModel, activity: ActivityCreate) {
84 const view = activity.object as ViewObject 84 const view = activity.object as ViewObject
85 85
86 const { video } = await getOrCreateAccountAndVideoAndChannel(view.object) 86 const { video } = await getOrCreateVideoAndAccountAndChannel(view.object)
87 87
88 const actor = await ActorModel.loadByUrl(view.actor) 88 const actor = await ActorModel.loadByUrl(view.actor)
89 if (!actor) throw new Error('Unknown actor ' + view.actor) 89 if (!actor) throw new Error('Unknown actor ' + view.actor)
@@ -103,7 +103,7 @@ async function processCreateVideoAbuse (actor: ActorModel, videoAbuseToCreateDat
103 const account = actor.Account 103 const account = actor.Account
104 if (!account) throw new Error('Cannot create dislike with the non account actor ' + actor.url) 104 if (!account) throw new Error('Cannot create dislike with the non account actor ' + actor.url)
105 105
106 const { video } = await getOrCreateAccountAndVideoAndChannel(videoAbuseToCreateData.object) 106 const { video } = await getOrCreateVideoAndAccountAndChannel(videoAbuseToCreateData.object)
107 107
108 return sequelizeTypescript.transaction(async t => { 108 return sequelizeTypescript.transaction(async t => {
109 const videoAbuseData = { 109 const videoAbuseData = {