diff options
| author | Adam Soltys <[email protected]> | 2026-09-04 19:02:49 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-04 19:02:49 -0700 |
| commit | 175600238fb3e9cf60bd65b0164ced476d18f445 (patch) | |
| tree | 795f7a8cc34fb946bb9679675024207cb3638afa /src/features | |
| parent | 90641c1244e70179027cf99c5bdab6c6b43dd28c (diff) | |
| download | coinosv3-175600238fb3e9cf60bd65b0164ced476d18f445.tar.gz coinosv3-175600238fb3e9cf60bd65b0164ced476d18f445.zip | |
Public kind-1 publishes (profile posts and thread replies) carry a NIP-89 client tag — ['client', 'coinos'], name-only since no kind-31990 handler coordinate is published yet — so other clients show "via coinos". Deliberately absent from everything encrypted (DMs, community wraps): private traffic needs no billboard
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MGzU12QrAA4G6BYGzGVdXz
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/messages.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 0aa7291..80230d6 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -36,6 +36,12 @@ const DM_RELAYS = ['wss://relay.coinos.io', 'wss://nos.lol']; const NOTIFIER = 'https://nwcpush.coinos.io'; const APP_BASE = 'https://v3.coinos.io'; const CACHE_MAX = 50; // messages kept per channel / per DM thread in feature state +// NIP-89 client attribution on PUBLIC notes (posts + thread replies) — other +// clients render it as "via coinos". Name-only: the fuller form appends a +// kind-31990 handler coordinate, which we haven't published. Deliberately +// absent from anything encrypted (DMs, community wraps) — those are private +// and need no billboard. +const CLIENT_TAG = ['client', 'coinos']; export function messagesFeature(ctx) { const { h, ui, render, wallet, toast, hook } = ctx; @@ -2011,7 +2017,7 @@ export function messagesFeature(ctx) { for (const c of caches) c.notes = [temp, ...c.notes]; render(); try { - const partial = { kind: 1, content: text, created_at: temp.created_at, tags: [] }; + const partial = { kind: 1, content: text, created_at: temp.created_at, tags: [CLIENT_TAG] }; const evt = id.signer instanceof Uint8Array ? finalizeEvent(partial, id.signer) : await id.signer.signEvent(partial); const relays = [...new Set([...(await notesRelays(id.pubkey)), ...wallet.nostrRelays()])]; const ok = await publishOn(relays, evt); @@ -2044,6 +2050,7 @@ export function messagesFeature(ctx) { ['e', rootId, '', 'root'], ...(target.id !== rootId ? [['e', target.id, '', 'reply']] : []), ...pTags.map((pk) => ['p', pk]), + CLIENT_TAG, ], }; const evt = id.signer instanceof Uint8Array ? finalizeEvent(partial, id.signer) : await id.signer.signEvent(partial); |
