diff options
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/comment.ts | 8 |
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 '../../. | |||
27 | import { AccountModel } from '../../../models/account/account' | 27 | import { AccountModel } from '../../../models/account/account' |
28 | import { Notifier } from '../../../lib/notifier' | 28 | import { Notifier } from '../../../lib/notifier' |
29 | import { Hooks } from '../../../lib/plugins/hooks' | 29 | import { Hooks } from '../../../lib/plugins/hooks' |
30 | import { ActorModel } from '../../../models/activitypub/actor' | ||
31 | import { VideoChannelModel } from '../../../models/video/video-channel' | ||
32 | import { VideoModel } from '../../../models/video/video' | ||
33 | import { sendDeleteVideoComment } from '../../../lib/activitypub/send' | ||
30 | 34 | ||
31 | const auditLogger = auditLoggerFactory('comments') | 35 | const auditLogger = auditLoggerFactory('comments') |
32 | const videoCommentRouter = express.Router() | 36 | const 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())) |