damus-io / damus

iOS nostr client
GNU General Public License v3.0
2k stars 288 forks source link

NIP-36 Support: Sensitive Content / Content Warning / NSFW #910

Open h3zjp opened 1 year ago

h3zjp commented 1 year ago

Can we support NIP-36 (Sensitive Content / Content Warning) to hide NSFW content?

Expected behavior

https://ul.h3z.jp/AfSwVpdu.png

Tap "表示するにはクリック" on the first image to see the text on the second image.

https://ul.h3z.jp/eDiDUCpY.png

Current Damus

https://ul.h3z.jp/fSd8TncT.jpeg

The NIP-36 specification is ignored and the text is displayed as is.

We Japanese are looking forward to this feature, so please implement it. Best regards.

alltheseas commented 1 year ago

Can you provide a noteID to the above example?

alltheseas commented 1 year ago

https://github.com/nostr-protocol/nips/blob/master/36.md

h3zjp commented 1 year ago

I don't understand what noteID refers to, but I will include the JSON query that was POST to the relay.

https://ul.h3z.jp/zlHDsCl8.png https://ul.h3z.jp/gs6RMW1s.png https://ul.h3z.jp/UjzwhYDT.png https://ul.h3z.jp/KzlJOYYa.png

h3zjp commented 1 year ago

The client used in the test is called "Rabbit". https://github.com/syusui-s/rabbit

The implementation of this client displays the message "表示するにはクリック" and below it the text written in the NIP-36 content-warning tag.

alltheseas commented 1 year ago

I don't understand what noteID refers to,

Can you send a link to the note?

Here is an example link to a random note:

https://damus.io/note1ha6v4zp77tvnnptv6muxnjj6al8sqm7uumcwff3qz0a6a0l4tf9qp9gucf

h3zjp commented 1 year ago

I see! So that's what you meant! I'm sorry.

This is it! https://damus.io/note1h9ccy5w8p4dr7750zaahyhztrzhv77vly5mwg2j6tkq7ky8n580qkncsdc

alltheseas commented 1 year ago

See related https://github.com/damus-io/damus/issues/73

alltheseas commented 1 year ago

https://github.com/damus-io/damus/issues/1458

alltheseas commented 1 year ago

@jb55 advised this is not the solution to nsfw content

jb55 commented 1 year ago

On Thu, Sep 21, 2023 at 02:20:57PM -0700, alltheseas wrote:

@jb55 advised this is not the solution to nsfw content

This is still useful and would be good to have, but doesn't solve the problem of hiding nsfw content from younger users. People will still post without censoring themselves, especially in the many clients that will exist without this feature.

alltheseas commented 1 year ago

@jb55 would a ML package (e.g. https://pypi.org/project/nsfw-detector/) integrated in Damus help with the job of detecting nsfw images?

jb55 commented 1 year ago

On Fri, Sep 22, 2023 at 08:27:34AM -0700, alltheseas wrote:

@jb55 would a ML package (e.g. https://pypi.org/project/nsfw-detector/) integrated in Damus help with the job of detecting nsfw images?

That's a python package, it can't be used in Damus. If we were to use an AI detector it would have to use neural cores to be efficient, so it would have to be a custom-built iOS lib.

I wonder if there's an API for this in iOS, because there is a setting for turning it on in certain apps like messages, etc.

alltheseas commented 1 year ago

Great find. Created new issue here: https://github.com/damus-io/damus/issues/1553