about summary refs log tree commit diff
path: root/src/lib/labeling/const.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-04-27 12:38:23 -0500
committerGitHub <noreply@github.com>2023-04-27 12:38:23 -0500
commit1d50ddb378d5c6954d4cf8a6145b4486b9497107 (patch)
tree85a55e9aef6692c304cc31d7c3bb239c186f7951 /src/lib/labeling/const.ts
parent51be8474db5e8074b1af233609b5eb455af31692 (diff)
downloadvoidsky-1d50ddb378d5c6954d4cf8a6145b4486b9497107.tar.zst
Refactor moderation to apply to accounts, profiles, and posts correctly (#548)
* Add ScreenHider component

* Add blur attribute to UserAvatar and UserBanner

* Remove dead suggested posts component and model

* Bump @atproto/api@0.2.10

* Rework moderation tooling to give a more precise DSL

* Add label mocks

* Apply finer grained moderation controls

* Refactor ProfileCard to just take the profile object

* Apply moderation to user listings and banner

* Apply moderation to notifications

* Fix lint

* Tune avatar & banner blur settings per platform

* 1.24
Diffstat (limited to 'src/lib/labeling/const.ts')
-rw-r--r--src/lib/labeling/const.ts20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/lib/labeling/const.ts b/src/lib/labeling/const.ts
index f68353222..6670e5413 100644
--- a/src/lib/labeling/const.ts
+++ b/src/lib/labeling/const.ts
@@ -1,23 +1,20 @@
 import {LabelPreferencesModel} from 'state/models/ui/preferences'
-
-export interface LabelValGroup {
-  id: keyof LabelPreferencesModel | 'illegal' | 'unknown'
-  title: string
-  subtitle?: string
-  warning?: string
-  values: string[]
-}
+import {LabelValGroup} from './types'
 
 export const ILLEGAL_LABEL_GROUP: LabelValGroup = {
   id: 'illegal',
   title: 'Illegal Content',
+  warning: 'Illegal Content',
   values: ['csam', 'dmca-violation', 'nudity-nonconsentual'],
+  imagesOnly: false, // not applicable
 }
 
 export const UNKNOWN_LABEL_GROUP: LabelValGroup = {
   id: 'unknown',
   title: 'Unknown Label',
+  warning: 'Content Warning',
   values: [],
+  imagesOnly: false,
 }
 
 export const CONFIGURABLE_LABEL_GROUPS: Record<
@@ -30,6 +27,7 @@ export const CONFIGURABLE_LABEL_GROUPS: Record<
     subtitle: 'i.e. Pornography',
     warning: 'Sexually Explicit',
     values: ['porn'],
+    imagesOnly: false, // apply to whole thing
   },
   nudity: {
     id: 'nudity',
@@ -37,6 +35,7 @@ export const CONFIGURABLE_LABEL_GROUPS: Record<
     subtitle: 'Including non-sexual and artistic',
     warning: 'Nudity',
     values: ['nudity'],
+    imagesOnly: true,
   },
   suggestive: {
     id: 'suggestive',
@@ -44,6 +43,7 @@ export const CONFIGURABLE_LABEL_GROUPS: Record<
     subtitle: 'Does not include nudity',
     warning: 'Sexually Suggestive',
     values: ['sexual'],
+    imagesOnly: true,
   },
   gore: {
     id: 'gore',
@@ -51,12 +51,14 @@ export const CONFIGURABLE_LABEL_GROUPS: Record<
     subtitle: 'Gore, self-harm, torture',
     warning: 'Violence',
     values: ['gore', 'self-harm', 'torture'],
+    imagesOnly: true,
   },
   hate: {
     id: 'hate',
     title: 'Political Hate-Groups',
     warning: 'Hate',
     values: ['icon-kkk', 'icon-nazi'],
+    imagesOnly: false,
   },
   spam: {
     id: 'spam',
@@ -64,6 +66,7 @@ export const CONFIGURABLE_LABEL_GROUPS: Record<
     subtitle: 'Excessive low-quality posts',
     warning: 'Spam',
     values: ['spam'],
+    imagesOnly: false,
   },
   impersonation: {
     id: 'impersonation',
@@ -71,5 +74,6 @@ export const CONFIGURABLE_LABEL_GROUPS: Record<
     subtitle: 'Accounts falsely claiming to be people or orgs',
     warning: 'Impersonation',
     values: ['impersonation'],
+    imagesOnly: false,
   },
 }