about summary refs log tree commit diff
path: root/src/lib/labeling/helpers.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-05-09 00:43:20 -0500
committerGitHub <noreply@github.com>2023-05-09 00:43:20 -0500
commitb756a2795807ad85051d572f82957356f9b5f44b (patch)
tree7a9c84b2bbbe590b048a55a04650b1cb8fc5b2d3 /src/lib/labeling/helpers.ts
parent7a176b3fdff7d27651b306e7550010b344dfa922 (diff)
downloadvoidsky-b756a2795807ad85051d572f82957356f9b5f44b.tar.zst
[APP-639] Improve nsfw handling & force hidden on iOS (#605)
* Identify adult content labels and handle them more specifically

* Change adult content defaults to more conservative settings

* Add an adultcontentenabled override that prohibits access on iOS

* Improve usability of the content hider

* Fix lint
Diffstat (limited to 'src/lib/labeling/helpers.ts')
-rw-r--r--src/lib/labeling/helpers.ts21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/lib/labeling/helpers.ts b/src/lib/labeling/helpers.ts
index 71ea43c08..baac0ed5a 100644
--- a/src/lib/labeling/helpers.ts
+++ b/src/lib/labeling/helpers.ts
@@ -137,12 +137,12 @@ export function getPostModeration(
 
   // warning cases
   if (postPref.pref === 'warn') {
-    if (postPref.desc.imagesOnly) {
+    if (postPref.desc.isAdultImagery) {
       return {
         avatar,
-        list: warnContent(postPref.desc.warning), // TODO make warnImages when there's time
-        thread: warnContent(postPref.desc.warning), // TODO make warnImages when there's time
-        view: warnContent(postPref.desc.warning), // TODO make warnImages when there's time
+        list: warnImages(postPref.desc.warning),
+        thread: warnImages(postPref.desc.warning),
+        view: warnImages(postPref.desc.warning),
       }
     }
     return {
@@ -401,10 +401,9 @@ function warnContent(reason: string) {
   }
 }
 
-// TODO
-// function warnImages(reason: string) {
-//   return {
-//     behavior: ModerationBehaviorCode.WarnImages,
-//     reason,
-//   }
-// }
+function warnImages(reason: string) {
+  return {
+    behavior: ModerationBehaviorCode.WarnImages,
+    reason,
+  }
+}