aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/lib/activitypub/process/process-create.ts2
-rw-r--r--server/models/video/video.ts4
2 files changed, 5 insertions, 1 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts
index 32be37e2d..e65b257c0 100644
--- a/server/lib/activitypub/process/process-create.ts
+++ b/server/lib/activitypub/process/process-create.ts
@@ -283,7 +283,7 @@ function createVideoComment (byActor: ActorModel, activity: ActivityCreate) {
283 const inReplyToComment = await VideoCommentModel.loadByUrl(comment.inReplyTo, t) 283 const inReplyToComment = await VideoCommentModel.loadByUrl(comment.inReplyTo, t)
284 if (!inReplyToComment) throw new Error('Unknown replied comment ' + comment.inReplyTo) 284 if (!inReplyToComment) throw new Error('Unknown replied comment ' + comment.inReplyTo)
285 285
286 video = await VideoModel.load(inReplyToComment.videoId) 286 video = await VideoModel.loadAndPopulateAccount(inReplyToComment.videoId)
287 287
288 const originCommentId = inReplyToComment.originCommentId || inReplyToComment.id 288 const originCommentId = inReplyToComment.originCommentId || inReplyToComment.id
289 objectToCreate = { 289 objectToCreate = {
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 4d15c2a50..918892938 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -507,6 +507,10 @@ export class VideoModel extends Model<VideoModel> {
507 return VideoModel.findById(id) 507 return VideoModel.findById(id)
508 } 508 }
509 509
510 static loadAndPopulateAccount (id: number) {
511 return VideoModel.scope([ ScopeNames.WITH_ACCOUNT_DETAILS ]).findById(id)
512 }
513
510 static loadByUrl (url: string, t?: Sequelize.Transaction) { 514 static loadByUrl (url: string, t?: Sequelize.Transaction) {
511 const query: IFindOptions<VideoModel> = { 515 const query: IFindOptions<VideoModel> = {
512 where: { 516 where: {