aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r--server/controllers/api/videos/comment.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/controllers/api/videos/comment.ts b/server/controllers/api/videos/comment.ts
index 39d521f5f..bc6d81a7c 100644
--- a/server/controllers/api/videos/comment.ts
+++ b/server/controllers/api/videos/comment.ts
@@ -27,6 +27,10 @@ import { auditLoggerFactory, CommentAuditView, getAuditIdFromRes } from '../../.
27import { AccountModel } from '../../../models/account/account' 27import { AccountModel } from '../../../models/account/account'
28import { Notifier } from '../../../lib/notifier' 28import { Notifier } from '../../../lib/notifier'
29import { Hooks } from '../../../lib/plugins/hooks' 29import { Hooks } from '../../../lib/plugins/hooks'
30import { ActorModel } from '../../../models/activitypub/actor'
31import { VideoChannelModel } from '../../../models/video/video-channel'
32import { VideoModel } from '../../../models/video/video'
33import { sendDeleteVideoComment } from '../../../lib/activitypub/send'
30 34
31const auditLogger = auditLoggerFactory('comments') 35const auditLogger = auditLoggerFactory('comments')
32const videoCommentRouter = express.Router() 36const videoCommentRouter = express.Router()
@@ -179,6 +183,10 @@ async function removeVideoComment (req: express.Request, res: express.Response)
179 183
180 await sequelizeTypescript.transaction(async t => { 184 await sequelizeTypescript.transaction(async t => {
181 await videoCommentInstance.destroy({ transaction: t }) 185 await videoCommentInstance.destroy({ transaction: t })
186
187 if (videoCommentInstance.isOwned() || videoCommentInstance.Video.isOwned()) {
188 await sendDeleteVideoComment(videoCommentInstance, t)
189 }
182 }) 190 })
183 191
184 auditLogger.delete(getAuditIdFromRes(res), new CommentAuditView(videoCommentInstance.toFormattedJSON())) 192 auditLogger.delete(getAuditIdFromRes(res), new CommentAuditView(videoCommentInstance.toFormattedJSON()))