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

View file

@ -617,21 +617,28 @@ fn custom_room_id_check(services: &Services, custom_room_id: &str) -> Result<Own
} else if custom_room_id.starts_with('!') { } else if custom_room_id.starts_with('!') {
return Err(Error::BadRequest( return Err(Error::BadRequest(
ErrorKind::InvalidParam, 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 { } else {
room_id = format!("!{custom_room_id}:{server_name}"); room_id = format!("!{custom_room_id}:{server_name}");
} }
OwnedRoomId::parse(room_id) OwnedRoomId::parse(room_id)
.map_err(Into::into) .map_err(Into::into)
.and_then( .and_then(|full_room_id| {
|full_room_id| { if full_room_id
if full_room_id.server_name().expect("failed to extract server name from room ID") != server_name { .server_name()
Err(Error::BadRequest(ErrorKind::InvalidParam, "Custom room ID must be on this server.")) .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 { } else {
Ok(full_room_id) Ok(full_room_id)
} }
} })
)
.inspect(|full_room_id| { .inspect(|full_room_id| {
debug_info!(?full_room_id, "Full custom 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, pub rocksdb_compaction_ioprio_idle: bool,
/// Enables RocksDB compaction. You should never ever have to set this /// 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 to false. If you for some reason find yourself needing to use
/// option as part of troubleshooting or a bug, please reach out to us in /// this option as part of troubleshooting or a bug, please reach out to us
/// the conduwuit Matrix room with information and details. /// in the conduwuit Matrix room with information and details.
/// ///
/// Disabling compaction will lead to a significantly bloated and /// Disabling compaction will lead to a significantly bloated and
/// explosively large database, gradually poor performance, unnecessarily /// explosively large database, gradually poor performance, unnecessarily