From e0b1231b2075e81afe06c2df4fdf55e148f05f3a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 8 Oct 2021 11:26:17 +0200 Subject: Fix autoblock message on upload page --- client/src/app/+videos/+video-edit/video-add.component.html | 2 +- client/src/app/+videos/+video-edit/video-add.component.ts | 2 +- client/src/app/core/users/user.model.ts | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/app/+videos/+video-edit/video-add.component.html b/client/src/app/+videos/+video-edit/video-add.component.html index 7dd9ba357..29cf08e75 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.html +++ b/client/src/app/+videos/+video-edit/video-add.component.html @@ -15,7 +15,7 @@ -
+
{{ uploadMessages.autoBlock }}
diff --git a/client/src/app/+videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts index 46881be4e..bcb2fc4fa 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.ts +++ b/client/src/app/+videos/+video-edit/video-add.component.ts @@ -43,7 +43,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { hasNoQuotaLeft = false hasNoQuotaLeftDaily = false - private serverConfig: HTMLServerConfig + serverConfig: HTMLServerConfig constructor ( private auth: AuthService, diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index 00078af5d..c0e5d3169 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts @@ -2,6 +2,7 @@ import { Account } from '@app/shared/shared-main/account/account.model' import { hasUserRight } from '@shared/core-utils/users' import { ActorImage, + HTMLServerConfig, NSFWPolicyType, User as UserServerModel, UserAdminFlag, @@ -136,7 +137,9 @@ export class User implements UserServerModel { return this.videoQuota === 0 || this.videoQuotaDaily === 0 } - isAutoBlocked () { + isAutoBlocked (serverConfig: HTMLServerConfig) { + if (serverConfig.autoBlacklist.videos.ofUsers.enabled !== true) return false + return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST } } -- cgit v1.2.3