aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/names.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-15 19:16:42 -0700
committerAdam Soltys <[email protected]>2026-08-15 19:16:42 -0700
commit0fb0496109aee2ec0bb0c46f29f17392138978e8 (patch)
treee7a575876bf9f042bfbfb642b209f6f3153a3a3f /src/features/names.js
parent79d360e0f4221256675b274127e0abacaf54be28 (diff)
downloadcoinosv3-0fb0496109aee2ec0bb0c46f29f17392138978e8.tar.gz
coinosv3-0fb0496109aee2ec0bb0c46f29f17392138978e8.zip
A new name offers its hand to the address: saving a renamed profile proposes the matching @coinos.io, and any rename repoints the kind-0 lightning address so zaps never chase a released name
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv
Diffstat (limited to 'src/features/names.js')
-rw-r--r--src/features/names.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/features/names.js b/src/features/names.js
index f386a47..b021956 100644
--- a/src/features/names.js
+++ b/src/features/names.js
@@ -78,6 +78,10 @@ export function namesFeature(ctx) {
save({ name, domain: DOMAIN, uri, offerPk: hook('nwcOfferPubkey') || null, updated: Date.now() });
if (prev && prev !== name) {
post('/register', 'DELETE', { name: prev, domain: DOMAIN }).catch(() => {});
+ // the old address just died — a kind 0 still pointing at it would send
+ // zaps into the void, so the profile's lud16 follows the rename
+ // (messages only touches it if it pointed at the released name)
+ Promise.resolve(hook('addressRenamed', `${prev}@${DOMAIN}`, `${name}@${DOMAIN}`)).catch(() => {});
}
return j;
}