From e27eaccee624d9bbc84ce4443d7cfba2db4fa15d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 20 Sep 2026 23:23:13 -0700 Subject: 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 --- src/features/messages.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/features') 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 -- cgit v1.2.3