ContactKey

value class ContactKey(val value: String)(source)

Type-safe wrapper for contact key strings (channel index + node address).

Contact keys are persisted as strings in the format "<channel><nodeId>" (e.g. "0^all", "1!a1b2c3d4").

A broadcast conversation whose channel is no longer configured is retired rather than deleted, and takes the form "~<token>^all" — see retiredBroadcast. A retired key has no channelOrNull, which is what makes every "which live slot is this?" site treat it as having none without needing to know the form exists.

Constructors

Link copied to clipboard
constructor(value: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Parsed NodeAddress for the contact.

Link copied to clipboard

The node address portion: everything after the channel digit (or the retired token), or the whole key when there is no prefix at all. Empty if the key is empty.

Link copied to clipboard

The channel index (first character). Returns 0 if the key is empty or has no channel digit.

Link copied to clipboard

The channel index if the key carries a leading channel digit, or null for a legacy unprefixed direct-message key or a retired conversation. Callers that must distinguish "channel 0" from "no channel prefix" (e.g. PKI vs legacy DM routing) need this rather than channel.

Link copied to clipboard

True when this conversation's channel is no longer configured on the radio and its history is read-only.

Link copied to clipboard

The channel-identity token a retired conversation is parked under, or null when this key is live.

Link copied to clipboard