Skip to content

Conversation

kunigaku
Copy link
Contributor

Filters posts with the NIP-36 "content-warning" tag in the same way as the #nsfw hashtag.
https://github.com/nostr-protocol/nips/blob/master/36.md

Related issues: #910, #1412

Screenshots:
Show #nsfw and NIP-36
Show #nsfw and NIP-36
Hide #nsfw and NIP-36
Hide #nsfw and NIP-36

This is a test post.
https://damus.io/note1z0jcu9wgevaajcvk947ea2aj8wv9nxlttj5dvj6wxfyz0v5ehpnq8t9l2p

The post on Rabbit.
https://rabbit.syusui.net/#/npub1l6gzvpjar07swqqq9gg9eshgtvtp2tyynv405jrsgxwrhpcupgcqqvy0hm
Rabbit Screenshot hide NIP-36
Rabbit Screenshot show NIP-36

/// Simple filter to determine whether to show posts with #nsfw tags
func nsfw_tag_filter(ev: NostrEvent) -> Bool {
return ev.referenced_hashtags.first(where: { t in t.hashtag == "nsfw" }) == nil
return ev.referenced_hashtags.first(where: { t in t.hashtag == "nsfw" }) == nil && References<ContentWarningTag>(tags: ev.tags).first == nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont we need to check the reason == nsfw in the content warning case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider any post with the "content-warning" tag as sensitive.
Therefore, there is no need to check the "reason."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a post without reason.
https://nostter.app/nevent1qqswynxvz0wth52wjq3xyq7l795q3w0fe83ym0ewetnx8u9gslrhmhswwl5pw

{
  "content": "",
  "created_at": 1718237816,
  "id": "e24ccc13dcbbd14e90226203dff16808b9e9c9e24dbf2ecae663f0a887c77dde",
  "kind": 1,
  "pubkey": "1a35b54ef7752af54cacbeedf0f349e320f0a2ee50142883134c3ee31879ce71",
  "sig": "3a1dc4873e2a8527ecfce2526af8701702e0d1bb3b4c4ecf45e8026cae27ceb84f40144e8409ca4a325e8e93f39fcba75ddf1c7ad0e57ba53f7e538a4da92b2a",
  "tags": [
    [
      "content-warning"
    ]
  ]
}

@jb55
Copy link
Collaborator

jb55 commented Jun 14, 2024 via email

@mattn
Copy link
Contributor

mattn commented Jun 15, 2024

Non-developers are unlikely to comment on GitHub. But I know many Nostr users who would love to have NIP-36. And they are unfortunately resigned to the fact that Damus does not have it.

@mattn
Copy link
Contributor

mattn commented Jun 15, 2024

IMO, whatever the reason, I think the note-author's consideration that "maybe some people don't want to see it" should be taken into account.

@TsukemonoGit
Copy link

When posting images that may be objectionable to a certain number of people, a content-warning may be added as a warning (e.g., because of insects), but a content-warning added by another client's user out of consideration for others is not effective for Damus users, causing them to feel uncomfortable.

@jb55
Copy link
Collaborator

jb55 commented Jun 15, 2024 via email

@jb55
Copy link
Collaborator

jb55 commented Jun 15, 2024 via email

@TsukemonoGit
Copy link

I think a proper control that hides content with a collapsible control on the note without hiding the entire note would be a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants