fix(desktop): encode resolved mentions as NIP-27 Nostr URIs - #4398
Open
fresh3nough wants to merge 1 commit into
Open
fix(desktop): encode resolved mentions as NIP-27 Nostr URIs#4398fresh3nough wants to merge 1 commit into
fresh3nough wants to merge 1 commit into
Conversation
Store resolved @mentions as stable nostr:npub1… references on send and edit so renames cannot break historical mentions, and materialize inbound nostr:npub1…/nprofile1… prose into mention chips with current profile names even when no p-tag is present. Closes block#2319 Signed-off-by: anonwurcod <anonwurcod@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@namementions to stable NIP-27nostr:npub1…URIs on send and edit so profile renames cannot break historical mentionsptags for notification and routing; encoding only changes the prose bodynostr:npub1…andnostr:nprofile1…prose into the existing mention chips using current profile identity, including references that arrive without a recipient tag@, and non-profile NIP-21 entities from rewrite; longest complete name wins on overlap; conversion is idempotentFixes #2319
Why this PR
Open #2503 also touches NIP-27, but bundles it with unrelated community-create and workflow-query fixes and leaves important remainder work:
nprofilesupportThis PR is scoped solely to #2319 and covers the full encode + display path on current
main.Test plan
@namemention and confirm the published event body containsnostr:npub1…while the composer still showed@namenostr:npub1…and noptag; confirm it renders as a clickable mention chip with the current profile namenostr:nprofile1…(with relay hints) the same way\@, and non-profilenostr:entities are left unchanged