fix: reject bare --room value in hivectl matrix invite with a clear hint
This commit is contained in:
parent
e8d5eee659
commit
e7a68472fd
1 changed files with 6 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue