diff options
Diffstat (limited to 'server/lib/activitypub/video-comments.ts')
-rw-r--r-- | server/lib/activitypub/video-comments.ts | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts index e87301fe7..3f9d8f0fc 100644 --- a/server/lib/activitypub/video-comments.ts +++ b/server/lib/activitypub/video-comments.ts | |||
@@ -34,8 +34,7 @@ async function videoCommentActivityObjectToDBAttributes (video: VideoModel, acto | |||
34 | accountId: actor.Account.id, | 34 | accountId: actor.Account.id, |
35 | inReplyToCommentId, | 35 | inReplyToCommentId, |
36 | originCommentId, | 36 | originCommentId, |
37 | createdAt: new Date(comment.published), | 37 | createdAt: new Date(comment.published) |
38 | updatedAt: new Date(comment.updated) | ||
39 | } | 38 | } |
40 | } | 39 | } |
41 | 40 | ||
@@ -74,12 +73,7 @@ async function addVideoComment (videoInstance: VideoModel, commentUrl: string) { | |||
74 | const entry = await videoCommentActivityObjectToDBAttributes(videoInstance, actor, body) | 73 | const entry = await videoCommentActivityObjectToDBAttributes(videoInstance, actor, body) |
75 | if (!entry) return { created: false } | 74 | if (!entry) return { created: false } |
76 | 75 | ||
77 | const [ comment, created ] = await VideoCommentModel.findOrCreate({ | 76 | const [ comment, created ] = await VideoCommentModel.upsert<VideoCommentModel>(entry, { returning: true }) |
78 | where: { | ||
79 | url: body.id | ||
80 | }, | ||
81 | defaults: entry | ||
82 | }) | ||
83 | comment.Account = actor.Account | 77 | comment.Account = actor.Account |
84 | comment.Video = videoInstance | 78 | comment.Video = videoInstance |
85 | 79 | ||