Skip to main content

recipient_label

Function recipient_label 

Source
pub fn recipient_label(team: &TeamSnapshot, recipient_id: &str) -> String
Expand description

Return the operator-facing label for a MessageRow.recipient. Recipients come in three shapes:

  • <project>:<agent> — an agent id. Resolves via agent_label to the agent’s display name (or canonical id when unset).
  • channel:<project>:<name> — a broadcast target. Strips the channel: prefix and renders as #<name> (matches the precedent in compose::ComposeTarget::label + the MailboxFirst-layout channel list).
  • user:<handle> (e.g. user:telegram) — an operator-facing bridge. Renders verbatim; operators recognize the shape and stripping the prefix would lose useful context.

Owned String return (rather than the &str shape of agent_label) because the channel-recipient path constructs #<name> at call time. Cheap allocation in a single-row render; 180-char body cap dominates.