]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-comment.ts
Upgrade minor dependencies
[github/Chocobozzz/PeerTube.git] / server / models / video / video-comment.ts
index e1faf2b9acf70ae4f0d4f354bdebed480577a1e0..fa77455bc8714bfa0c90e98c3fd75fcea2266882 100644 (file)
@@ -16,7 +16,7 @@ import {
 } from 'sequelize-typescript'
 import { getServerActor } from '@server/models/application/application'
 import { MAccount, MAccountId, MUserAccountId } from '@server/types/models'
-import { AttributesOnly } from '@shared/core-utils'
+import { AttributesOnly } from '@shared/typescript-utils'
 import { VideoPrivacy } from '@shared/models'
 import { ActivityTagObject, ActivityTombstoneObject } from '../../../shared/models/activitypub/objects/common-objects'
 import { VideoCommentObject } from '../../../shared/models/activitypub/objects/video-comment-object'
@@ -585,7 +585,7 @@ export class VideoCommentModel extends Model<Partial<AttributesOnly<VideoComment
 
     if (accountId) {
       whereAnd.push({
-        [Op.eq]: accountId
+        accountId
       })
     }
 
@@ -739,6 +739,12 @@ export class VideoCommentModel extends Model<Partial<AttributesOnly<VideoComment
     return this.Account.isOwned()
   }
 
+  markAsDeleted () {
+    this.text = ''
+    this.deletedAt = new Date()
+    this.accountId = null
+  }
+
   isDeleted () {
     return this.deletedAt !== null
   }
@@ -868,7 +874,10 @@ export class VideoCommentModel extends Model<Partial<AttributesOnly<VideoComment
     return {
       type: 'Note' as 'Note',
       id: this.url,
+
       content: this.text,
+      mediaType: 'text/markdown',
+
       inReplyTo,
       updated: this.updatedAt.toISOString(),
       published: this.createdAt.toISOString(),