Changes
diff --git a/src/config.rs b/src/config.rs
index ea5fd99..13dfa6e 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -428,7 +428,7 @@ fn validate_rooms(values: Vec<String>) -> Result<HashSet<String>, ConfigurationE
let mut rooms = HashSet::with_capacity(values.len());
for room_id in values {
if !room_id.starts_with('!')
- || !room_id.contains(':')
+ || room_id.len() == 1
|| room_id.chars().any(char::is_whitespace)
{
return Err(invalid(
@@ -679,6 +679,18 @@ user_agent = "LisaBot/1.0"
assert_eq!(format!("{:?}", config.matrix.password), "[REDACTED]");
}
+ #[test]
+ fn accepts_room_id_without_server_name() {
+ let config = CONFIG.replace("!private:example.test", "!private");
+ let config = AppConfig::from_toml_with_env(&config, |name| {
+ matches!(name, "LISA_MATRIX_PASSWORD" | "LISA_LLM_API_KEY")
+ .then(|| "secret-canary".to_owned())
+ })
+ .unwrap();
+
+ assert!(config.matrix.allowed_room_ids.contains("!private"));
+ }
+
#[test]
fn rejects_literal_secret_and_duplicate_room() {
let literal = CONFIG.replace("env:LISA_MATRIX_PASSWORD", "secret");