Prevent creating custom room IDs belonging to other servers

This commit is contained in:
nexy7574 2025-04-20 02:46:16 +01:00
parent 6920814da9
commit d3022b4112
No known key found for this signature in database
GPG key ID: 0FA334385D0B689F

View file

@ -621,6 +621,11 @@ fn custom_room_id_check(services: &Services, custom_room_id: &str) -> Result<Own
OwnedRoomId::parse(room_id)
.map_err(Into::into)
.inspect(|full_room_id| debug_info!(?full_room_id, "Full custom room ID"))
.inspect(|full_room_id| {
debug_info!(?full_room_id, "Full custom room ID");
if full_room_id.server_name().expect("failed to extract server name from room ID") != server_name {
error!("Custom room ID does not match server name");
}
})
.inspect_err(|e| warn!(?e, ?custom_room_id, "Failed to create room with custom room ID",))
}