aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-comment.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/video-comment.ts')
-rw-r--r--server/lib/video-comment.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/video-comment.ts b/server/lib/video-comment.ts
index c76570a5d..02f160fe8 100644
--- a/server/lib/video-comment.ts
+++ b/server/lib/video-comment.ts
@@ -1,5 +1,6 @@
1import { cloneDeep } from 'lodash' 1import { cloneDeep } from 'lodash'
2import * as Sequelize from 'sequelize' 2import * as Sequelize from 'sequelize'
3import express from 'express'
3import { logger } from '@server/helpers/logger' 4import { logger } from '@server/helpers/logger'
4import { sequelizeTypescript } from '@server/initializers/database' 5import { sequelizeTypescript } from '@server/initializers/database'
5import { ResultList } from '../../shared/models' 6import { ResultList } from '../../shared/models'
@@ -10,7 +11,7 @@ import { sendCreateVideoComment, sendDeleteVideoComment } from './activitypub/se
10import { getLocalVideoCommentActivityPubUrl } from './activitypub/url' 11import { getLocalVideoCommentActivityPubUrl } from './activitypub/url'
11import { Hooks } from './plugins/hooks' 12import { Hooks } from './plugins/hooks'
12 13
13async function removeComment (videoCommentInstance: MCommentOwnerVideo) { 14async function removeComment (videoCommentInstance: MCommentOwnerVideo, req: express.Request, res: express.Response) {
14 const videoCommentInstanceBefore = cloneDeep(videoCommentInstance) 15 const videoCommentInstanceBefore = cloneDeep(videoCommentInstance)
15 16
16 await sequelizeTypescript.transaction(async t => { 17 await sequelizeTypescript.transaction(async t => {
@@ -25,7 +26,7 @@ async function removeComment (videoCommentInstance: MCommentOwnerVideo) {
25 26
26 logger.info('Video comment %d deleted.', videoCommentInstance.id) 27 logger.info('Video comment %d deleted.', videoCommentInstance.id)
27 28
28 Hooks.runAction('action:api.video-comment.deleted', { comment: videoCommentInstanceBefore }) 29 Hooks.runAction('action:api.video-comment.deleted', { comment: videoCommentInstanceBefore, req, res })
29} 30}
30 31
31async function createVideoComment (obj: { 32async function createVideoComment (obj: {