]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/abuse/abuse.ts
Translated using Weblate (Vietnamese)
[github/Chocobozzz/PeerTube.git] / server / models / abuse / abuse.ts
index 4344df006ebb810dbf42a74ce0aaeda2907df1e9..4ce40bf2f389736210d25f05306cb86e4447447e 100644 (file)
@@ -34,13 +34,13 @@ import { AttributesOnly } from '@shared/typescript-utils'
 import { ABUSE_STATES, CONSTRAINTS_FIELDS } from '../../initializers/constants'
 import { MAbuseAdminFormattable, MAbuseAP, MAbuseFull, MAbuseReporter, MAbuseUserFormattable, MUserAccountId } from '../../types/models'
 import { AccountModel, ScopeNames as AccountScopeNames, SummaryOptions as AccountSummaryOptions } from '../account/account'
-import { getSort, throwIfNotValid } from '../utils'
+import { getSort, throwIfNotValid } from '../shared'
 import { ThumbnailModel } from '../video/thumbnail'
 import { ScopeNames as VideoScopeNames, VideoModel } from '../video/video'
 import { VideoBlacklistModel } from '../video/video-blacklist'
 import { ScopeNames as VideoChannelScopeNames, SummaryOptions as ChannelSummaryOptions, VideoChannelModel } from '../video/video-channel'
 import { ScopeNames as CommentScopeNames, VideoCommentModel } from '../video/video-comment'
-import { buildAbuseListQuery, BuildAbusesQueryOptions } from './abuse-query-builder'
+import { buildAbuseListQuery, BuildAbusesQueryOptions } from './sql/abuse-query-builder'
 import { VideoAbuseModel } from './video-abuse'
 import { VideoCommentAbuseModel } from './video-comment-abuse'
 
@@ -436,7 +436,7 @@ export class AbuseModel extends Model<Partial<AttributesOnly<AbuseModel>>> {
 
   buildBaseVideoCommentAbuse (this: MAbuseUserFormattable) {
     // Associated video comment could have been destroyed if the video has been deleted
-    if (!this.VideoCommentAbuse || !this.VideoCommentAbuse.VideoComment) return null
+    if (!this.VideoCommentAbuse?.VideoComment) return null
 
     const entity = this.VideoCommentAbuse.VideoComment
 
@@ -563,6 +563,7 @@ export class AbuseModel extends Model<Partial<AttributesOnly<AbuseModel>>> {
     return {
       type: 'Flag' as 'Flag',
       content: this.reason,
+      mediaType: 'text/markdown',
       object,
       tag: predefinedReasons.map(r => ({
         type: 'Hashtag' as 'Hashtag',