diff options
| author | Adam Soltys <[email protected]> | 2026-09-20 23:23:13 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-20 23:23:13 -0700 |
| commit | e27eaccee624d9bbc84ce4443d7cfba2db4fa15d (patch) | |
| tree | 49077a2c8d02057b69601345270540068824114f /src | |
| parent | 501da85c85e014eb48e6cd7df246875fadf27cb3 (diff) | |
| download | coinosv3-e27eaccee624d9bbc84ce4443d7cfba2db4fa15d.tar.gz coinosv3-e27eaccee624d9bbc84ce4443d7cfba2db4fa15d.zip | |
Feeds: a following.space link is read before any naddr in the pasted text; the test clears its field between searches.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/messages.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 10828d9..beae756 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -3629,14 +3629,12 @@ export function messagesFeature(ctx) { // nostr:naddr — the pack it names. function parsePackLink(input) { const s = String(input || '').trim(); - const m = /naddr1[a-z0-9]+/i.exec(s); - if (m) { - const ref = parseNostrRef(m[0].toLowerCase()); - return ref && ref.type === 'addr' && ref.kind === PACK_KIND ? { pk: ref.pk, d: ref.d, relays: ref.relays || [] } : null; - } const link = /\/d\/([^/?#\s]+)[^?\s]*\?(?:[^#\s]*&)?p=([0-9a-f]{64})/i.exec(s); if (link) return { pk: link[2].toLowerCase(), d: decodeURIComponent(link[1]), relays: [] }; - return null; + const m = /naddr1[a-z0-9]+/i.exec(s); + if (!m) return null; + const ref = parseNostrRef(m[0].toLowerCase()); + return ref && ref.type === 'addr' && ref.kind === PACK_KIND ? { pk: ref.pk, d: ref.d, relays: ref.relays || [] } : null; } // Every pack the wide relays hold, once per session: the way to find one // by a few letters of its title — NIP-50 search only knows the packs the |
