Skip to main content

cmd_destroy

Function cmd_destroy 

Source
pub async fn cmd_destroy(
    room_id: &str,
    socket: Option<&Path>,
    token: &str,
) -> Result<()>
Expand description

One-shot destroy subcommand: connect to daemon, destroy a room, print result.

Sends a DESTROY:<room_id> request to the daemon socket. The daemon validates the token, signals shutdown to connected clients, removes the room from its map, and preserves the chat file on disk.

socket overrides the default daemon socket path (auto-discovered if None). token is required for authentication — the daemon validates it against the global UserRegistry.