Files
amethyst/commons
Claude 0fc81cf79d feat: compose private replies and private posts via NIP-17 gift wraps
Phase 2 of the private-notes plan: the short-note composer gains a
private (lock) toggle that gift-wraps the kind-1 to its p-tagged users
plus a self-copy instead of publishing it.

- NIP17Factory.createNoteNIP17: wraps a TextNoteEvent template to its
  taggedUserIds + the sender (only the unsigned rumor form travels)
- Account.sendPrivateNote: signs, wraps, and routes each wrap to the
  recipient's DM relays via the existing broadcastPrivately path
- ShortNotePostViewModel: wantsPrivateNote/privateNoteLocked state;
  forced ON and locked when replying to an unsealed rumor (and when
  reloading a drafted private reply); private wins over anonymous and
  scheduled modes so a locked reply can never fall through to a public
  publish path
- ShortNotePostScreen: lock toggle in the bottom action row; mutually
  exclusive with polls; schedule and anonymous hidden while private
- ReactionsRow: reply re-enabled on private rumors now that the
  composer locks privacy for them

Drafts stay enabled: TextNoteEvent does not implement ExposeInDraft, so
draft wrappers carry no anchor e-tags — the parent rumor id only exists
inside the NIP-44 encrypted draft content.

Verified by PrivateNoteFactoryTest: wraps cover p-tags + self, and the
recipient's unwrap yields a rumor with the same id and an empty sig
(the Note.isPrivateRumor() discriminator).

https://claude.ai/code/session_01B39MQmrT3dz137nfpXABvo
2026-06-11 20:53:52 +00:00
..