X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fvideo-comment.ts;h=fe83d23e7b1c766646a0dbc2a4909024f72b56e2;hb=1def3c526ec385cbd2112d9907e8a4a73af110ca;hp=bb811bd2c3d4b5749eb075b56cf3e428d15d80fe;hpb=5c5e587307a27e173333789b5b5167d35f468b01;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/video-comment.ts b/server/lib/video-comment.ts index bb811bd2c..fe83d23e7 100644 --- a/server/lib/video-comment.ts +++ b/server/lib/video-comment.ts @@ -7,9 +7,9 @@ import { sendCreateVideoComment } from './activitypub/send' import { MAccountDefault, MComment, MCommentOwnerVideoReply, MVideoFullLight } from '../typings/models' async function createVideoComment (obj: { - text: string, - inReplyToComment: MComment | null, - video: MVideoFullLight, + text: string + inReplyToComment: MComment | null + video: MVideoFullLight account: MAccountDefault }, t: Sequelize.Transaction) { let originCommentId: number | null = null @@ -73,9 +73,16 @@ function buildFormattedCommentTree (resultList: ResultList): return thread } +function markCommentAsDeleted (comment: MCommentOwnerVideoReply): void { + comment.text = '' + comment.deletedAt = new Date() + comment.accountId = null +} + // --------------------------------------------------------------------------- export { createVideoComment, - buildFormattedCommentTree + buildFormattedCommentTree, + markCommentAsDeleted }