just remove double quotes if found instead

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-01-24 18:16:25 -05:00 committed by June
parent e0419d9c5d
commit 9858b33b37

View file

@ -92,18 +92,11 @@ pub async fn create_room_route(
} }
let full_room_id = "!".to_owned() let full_room_id = "!".to_owned()
+ custom_room_id_s.as_str() + &custom_room_id_s.replace('"', "")
+ ":" + ":"
+ services().globals.server_name().as_ref(); + services().globals.server_name().as_ref();
debug!("Full room ID: {}", full_room_id); debug!("Full room ID: {}", full_room_id);
if full_room_id.contains('"') {
return Err(Error::BadRequest(
ErrorKind::InvalidParam,
"Custom room ID contained `\"` which is not allowed.",
));
}
room_id = RoomId::parse(full_room_id).map_err(|e| { room_id = RoomId::parse(full_room_id).map_err(|e| {
info!( info!(
"User attempted to create room with custom room ID but failed parsing: {}", "User attempted to create room with custom room ID but failed parsing: {}",