From e7a68472fd9b044c159b24a9996faa215393e7eb Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 5 Jun 2026 20:18:12 +0200 Subject: [PATCH] fix: reject bare --room value in hivectl matrix invite with a clear hint --- hive-c0re/src/matrix.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hive-c0re/src/matrix.rs b/hive-c0re/src/matrix.rs index e973f18e..e0bf1ebf 100644 --- a/hive-c0re/src/matrix.rs +++ b/hive-c0re/src/matrix.rs @@ -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(