diff options
Diffstat (limited to 'server/lib/video-comment.ts')
-rw-r--r-- | server/lib/video-comment.ts | 5 |
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 @@ | |||
1 | import { cloneDeep } from 'lodash' | 1 | import { cloneDeep } from 'lodash' |
2 | import * as Sequelize from 'sequelize' | 2 | import * as Sequelize from 'sequelize' |
3 | import express from 'express' | ||
3 | import { logger } from '@server/helpers/logger' | 4 | import { logger } from '@server/helpers/logger' |
4 | import { sequelizeTypescript } from '@server/initializers/database' | 5 | import { sequelizeTypescript } from '@server/initializers/database' |
5 | import { ResultList } from '../../shared/models' | 6 | import { ResultList } from '../../shared/models' |
@@ -10,7 +11,7 @@ import { sendCreateVideoComment, sendDeleteVideoComment } from './activitypub/se | |||
10 | import { getLocalVideoCommentActivityPubUrl } from './activitypub/url' | 11 | import { getLocalVideoCommentActivityPubUrl } from './activitypub/url' |
11 | import { Hooks } from './plugins/hooks' | 12 | import { Hooks } from './plugins/hooks' |
12 | 13 | ||
13 | async function removeComment (videoCommentInstance: MCommentOwnerVideo) { | 14 | async 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 | ||
31 | async function createVideoComment (obj: { | 32 | async function createVideoComment (obj: { |