From 3c4b0c5000c32ffab68a734959a34b2f97de1f06 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 28 Oct 2026 00:39:51 -0700 Subject: A gift link names its sender: the link carries the sender's nostr key, signed over the gift's code (#f=…, beside the note), so the claim screen shows "From " and claiming follows them. A signature that doesn't match the code names nobody, so a link can't be passed on as someone else's gift. "Show it's from me" is ticked by default when making a gift, and unticking it is remembered; the gift's record keeps the sender, so View and Copy link again keep it too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- src/features/messages.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/features/messages.js') diff --git a/src/features/messages.js b/src/features/messages.js index 6c6b48d..76d8c4f 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -18457,6 +18457,21 @@ export function messagesFeature(ctx) { }, avatar(pk, 'chat-avatar ' + (big ? 'send-avatar' : 'mini'), false), h('span', { class: big ? '' : 'small' }, displayName(pk))); }, + // a gift link names its sender: sign its template as us (gifts.js) + async signGiftFrom(tmpl) { + const id = await identity(); + if (!id) return null; + return id.signer instanceof Uint8Array ? finalizeEvent(tmpl, id.signer) : id.signer.signEvent(tmpl); + }, + // A claimed gift's sender: follow them, once any follow publish in + // flight (a fresh wallet's starter follows) has landed — followMany + // drops a call that arrives mid-publish. + async followGiftSender(pk) { + for (let i = 0; followsPub && i < 60; i++) await new Promise((r) => setTimeout(r, 500)); + if (!(await identity())) return false; + await followMany([pk]).catch(() => {}); + return true; + }, // A sign-in (Google, passkey, key) that found no wallet on its identity: // the same start, but only the follows of an identity that follows // nobody yet — an established nostr user keeps their own list. -- cgit v1.2.3