feat: allow users to add a description to the sensitive content warning
- Add contentWarningReason() helper to TagArrayExt and EventExt for reading the reason from existing events - Add contentWarningDescription state to ShortNotePostViewModel, wired into event building and draft load/save/reset - Update ContentSensitivityExplainer to accept description state and render an OutlinedTextField for user input - Pass description state from ShortNotePostScreen to ContentSensitivityExplainer - Add "Reason (optional)" placeholder string resource https://claude.ai/code/session_01P2nkYdNiWXiAcfMPTRTVEW
This commit is contained in:
+2
@@ -25,3 +25,5 @@ import com.vitorpamplona.quartz.nip01Core.core.Event
|
||||
fun Event.isSensitive() = tags.isSensitive()
|
||||
|
||||
fun Event.isSensitiveOrNSFW() = tags.isSensitiveOrNSFW()
|
||||
|
||||
fun Event.contentWarningReason() = tags.contentWarningReason()
|
||||
|
||||
+2
@@ -28,3 +28,5 @@ val nsfwTags = setOf("nsfw", "nude", "NSFW", "NUDE", "Nsfw", "Nude")
|
||||
fun TagArray.isSensitive() = this.any(ContentWarningTag::isTag)
|
||||
|
||||
fun TagArray.isSensitiveOrNSFW() = this.any { ContentWarningTag.isTag(it) || HashtagTag.isAnyTagged(it, nsfwTags) }
|
||||
|
||||
fun TagArray.contentWarningReason() = this.firstOrNull(ContentWarningTag::isTag)?.getOrNull(1)
|
||||
|
||||
Reference in New Issue
Block a user