diff options
author | Julien Maulny <julien.maulny@protonmail.com> | 2019-11-15 19:05:08 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-12-04 09:36:45 +0100 |
commit | 69222afac8f8c41d90295b33f0695bbff352851e (patch) | |
tree | 63fe1faea94dd3bfc54e633631eecb275c969e54 /server/lib/video-comment.ts | |
parent | 69c7f7525ddf13b7ced787d8b72ac74b43665517 (diff) | |
download | PeerTube-69222afac8f8c41d90295b33f0695bbff352851e.tar.gz PeerTube-69222afac8f8c41d90295b33f0695bbff352851e.tar.zst PeerTube-69222afac8f8c41d90295b33f0695bbff352851e.zip |
Soft delete video comments instead of detroy
Diffstat (limited to 'server/lib/video-comment.ts')
-rw-r--r-- | server/lib/video-comment.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/video-comment.ts b/server/lib/video-comment.ts index bb811bd2c..b8074e6d2 100644 --- a/server/lib/video-comment.ts +++ b/server/lib/video-comment.ts | |||
@@ -73,9 +73,16 @@ function buildFormattedCommentTree (resultList: ResultList<VideoCommentModel>): | |||
73 | return thread | 73 | return thread |
74 | } | 74 | } |
75 | 75 | ||
76 | function markCommentAsDeleted (comment: MCommentOwnerVideoReply): void { | ||
77 | comment.text = '' | ||
78 | comment.deletedAt = new Date() | ||
79 | comment.accountId = null | ||
80 | } | ||
81 | |||
76 | // --------------------------------------------------------------------------- | 82 | // --------------------------------------------------------------------------- |
77 | 83 | ||
78 | export { | 84 | export { |
79 | createVideoComment, | 85 | createVideoComment, |
80 | buildFormattedCommentTree | 86 | buildFormattedCommentTree, |
87 | markCommentAsDeleted | ||
81 | } | 88 | } |