Replace indexed mentions with NIP-27

Changelog-Fixed: Replace indexed mentions with NIP-27
Closes: #1213
This commit is contained in:
2023-05-30 23:41:41 -04:00
committed by William Casarin
parent 1d3c181b85
commit 14977fe3dd
6 changed files with 24 additions and 29 deletions

View File

@@ -60,24 +60,13 @@ func parse_nostr_ref_uri(_ p: Parser) -> ReferencedId? {
if !parse_str(p, "nostr:") {
return nil
}
guard let typ = parse_nostr_ref_uri_type(p) else {
guard let ref = parse_post_bech32_mention(p) else {
p.pos = start
return nil
}
if !parse_char(p, ":") {
p.pos = start
return nil
}
guard let pk = parse_hexstr(p, len: 64) else {
p.pos = start
return nil
}
// TODO: parse relays from nostr uris
return ReferencedId(ref_id: pk, relay_id: nil, key: typ)
return ref
}
func decode_universal_link(_ s: String) -> NostrLink? {