fix: reject bare --room value in hivectl matrix invite with a clear hint

This commit is contained in:
damocles 2026-06-05 20:18:12 +02:00 committed by mara
commit e7a68472fd

View file

@ -1182,7 +1182,12 @@ pub async fn invite_user(
// the persisted hive Space.
let room_id = match room_override {
Some(r) if r.starts_with('#') => resolve_room_alias(client, admin_token, r).await?,
Some(r) => r.to_owned(),
Some(r) if r.starts_with('!') => r.to_owned(),
Some(r) => anyhow::bail!(
"matrix: --room {r:?} is neither a room id nor an alias; \
prefix with '!' for a room id (!abc:server) or '#' for an \
alias (#name:server)"
),
None => std::fs::read_to_string(hive_space_room_id_path())
.map(|s| s.trim().to_owned())
.context(