chore: Fix formatting

This commit is contained in:
Jade Ellis 2025-04-23 17:48:33 +01:00
parent f83238df78
commit 45872ede7a
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
3 changed files with 24 additions and 17 deletions

View file

@ -967,9 +967,9 @@
#rocksdb_compaction_ioprio_idle = true
# Enables RocksDB compaction. You should never ever have to set this
# option to false. If you for some reason find yourself needing to use this
# option as part of troubleshooting or a bug, please reach out to us in
# the conduwuit Matrix room with information and details.
# option to false. If you for some reason find yourself needing to use
# this option as part of troubleshooting or a bug, please reach out to us
# in the conduwuit Matrix room with information and details.
#
# Disabling compaction will lead to a significantly bloated and
# explosively large database, gradually poor performance, unnecessarily

View file

@ -614,24 +614,31 @@ fn custom_room_id_check(services: &Services, custom_room_id: &str) -> Result<Own
"Custom room ID contains an unexpected `:` which is not allowed.",
));
}
} else if custom_room_id.starts_with('!'){
} else if custom_room_id.starts_with('!') {
return Err(Error::BadRequest(
ErrorKind::InvalidParam,
"Room ID is prefixed with !, but is not fully qualified. You likely did not want this."));
"Room ID is prefixed with !, but is not fully qualified. You likely did not want \
this.",
));
} else {
room_id = format!("!{custom_room_id}:{server_name}");
}
OwnedRoomId::parse(room_id)
.map_err(Into::into)
.and_then(
|full_room_id| {
if full_room_id.server_name().expect("failed to extract server name from room ID") != server_name {
Err(Error::BadRequest(ErrorKind::InvalidParam, "Custom room ID must be on this server."))
} else {
Ok(full_room_id)
}
.and_then(|full_room_id| {
if full_room_id
.server_name()
.expect("failed to extract server name from room ID")
!= server_name
{
Err(Error::BadRequest(
ErrorKind::InvalidParam,
"Custom room ID must be on this server.",
))
} else {
Ok(full_room_id)
}
)
})
.inspect(|full_room_id| {
debug_info!(?full_room_id, "Full custom room ID");
})

View file

@ -1130,9 +1130,9 @@ pub struct Config {
pub rocksdb_compaction_ioprio_idle: bool,
/// Enables RocksDB compaction. You should never ever have to set this
/// option to false. If you for some reason find yourself needing to use this
/// option as part of troubleshooting or a bug, please reach out to us in
/// the conduwuit Matrix room with information and details.
/// option to false. If you for some reason find yourself needing to use
/// this option as part of troubleshooting or a bug, please reach out to us
/// in the conduwuit Matrix room with information and details.
///
/// Disabling compaction will lead to a significantly bloated and
/// explosively large database, gradually poor performance, unnecessarily