Created a PR on Damus to start extending support for NIP-27 (#[0], arthurfrance, #[1])

It adds the necessary parsing code to detect nostr: bech32 entities and represent them as regular mentions. nostr:naddr and nostr:nrelay get parsed but don’t have any special UI as of yet.

With this functionality, DMs are one step away from not leaking mentions any longer. Instead of converting mentions to #[idx] they could be converted to nostr:npub… and not added to the tags field.

Any feedback is welcomed!

https://github.com/damus-io/damus/pull/837

#[2]

Reply to this note

Please Login to reply.

Discussion

What’s the point of this spec? I’m so confused

Haha, one reason is to make it optional when you mention someone if you want it to notify the person or not. Clients can decide whether they place mentions into the tags field or if they leave them inline. And particularly for DMs to avoid the mentions being leaked to the public they should stay inline

ah got it, although not sure what the ui for that would be 🤔

Yeah I think clients should pick a default for now and worry about that later. But at the very least it will improve the privacy of DMs

In your DM code you will now be able to have a different render_blocks() function that makes the mentions inline and doesn’t put them into the tags field without it looking any different to the user

Yeah would be definitely handy for DMs, I was going to do an ad-hoc fix but this seems better

For the moment I’ve left the Mention object intact and have added a MentionBech32 that represents all the different Bech32 entities, but it might be easier to turn all inline mentions into Mention blocks without an index for now. Depends on how you feel about it. Don’t want to add too much complexity to your codebase :)

Cleaned it up a bunch to leave the Swift portion of the codebase as simple as possible. Added the commit to the PR!