mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-11 00:37:41 +00:00
Implements NIP-29 message pinning (nostr-protocol/nips#2379): Protocol (quartz): - GroupPinnedEvent (kind 39005): relay-signed pinned-message list, `d` group id + ordered `e` ids. - UpdatePinListEvent (kind 9010): moderator `update-pin-list` write, carries the full list so pin/unpin/reorder/clear are one submission. - Register both in EventFactory; add a pinnedEventIds tag helper. Model + cache: - RelayGroupChannel now folds the pin list (pinnedEventIds / isPinned) with the same createdAt-supersede guard as the roster. - LocalCache consumes 39005 into the channel and stores the 9010 write; 39005 added to the group's metadata REQ filter so pins load. Publish path: - Account.pin/unpin/updateRelayGroupPins + AccountViewModel wrappers. UI (non-intrusive, self-hiding): - Collapsed pinned-message bar under the top bar: shows the current pin, N-count cycling, tap to jump to the message in-feed (hoisted jump request threaded through the shared chat feed view). Renders nothing when the group has no pins. - Moderator-only Pin/Unpin action under "Show more" in the chat message bottom drawer, gated on membership.canModerate(). - Small pin glyph on pinned bubbles' footer. Tests: quartz build/parse round-trip for both kinds; channel pin-fold supersede/replace/clear semantics.