add back is_historical check on admin user creations from accidental removal

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-07-23 22:28:15 -04:00
parent 30ad5da5f1
commit 96f9d64111

View file

@ -42,6 +42,12 @@ pub(super) async fn create(
return Ok(RoomMessageEventContent::text_plain(format!("Userid {user_id} already exists"))); return Ok(RoomMessageEventContent::text_plain(format!("Userid {user_id} already exists")));
} }
if user_id.is_historical() {
return Ok(RoomMessageEventContent::text_plain(format!(
"User ID {user_id} does not conform to new Matrix identifier spec"
)));
}
let password = password.unwrap_or_else(|| utils::random_string(AUTO_GEN_PASSWORD_LENGTH)); let password = password.unwrap_or_else(|| utils::random_string(AUTO_GEN_PASSWORD_LENGTH));
// Create user // Create user