mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Visibility (open/private) was a create-time-only field: `channels create` took `--visibility`, but `channels update` only handled name/description/ttl, so there was no way to flip a channel's visibility after creation from the CLI. The plumbing already existed below the CLI: `buzz_sdk::build_update_channel` accepts a `visibility` arg and emits the `["visibility", v]` tag on the kind:9002 edit-metadata event, and the relay validates the value, gates it behind owner/admin auth, applies the DB update, invalidates the visibility/accessible-channel caches, and emits a visibility_changed event. The CLI just hardcoded `None` and exposed no flag. Wire `--visibility <open|private>` through `channels update` as a clap ValueEnum (matching `channels create`), so invalid values are rejected at parse time, and thread it into build_update_channel. Visibility is also included in the no-op guard and its error message. Live-tested against a real channel: open->private->open, each flip confirmed via the stored kind:9002 visibility tag. Co-authored-by: Tyler Longwell <tlongwell@block.xyz> Signed-off-by: Tyler Longwell <tlongwell@block.xyz>