diff --git a/src/admin/room/commands.rs b/src/admin/room/commands.rs index 1c90a998..35e40c8b 100644 --- a/src/admin/room/commands.rs +++ b/src/admin/room/commands.rs @@ -6,7 +6,7 @@ use crate::{admin_command, get_room_info, PAGE_SIZE}; #[admin_command] pub(super) async fn list_rooms( - &self, page: Option, _exclude_disabled: bool, _exclude_banned: bool, no_details: bool, + &self, page: Option, exclude_disabled: bool, exclude_banned: bool, no_details: bool, ) -> Result { // TODO: i know there's a way to do this with clap, but i can't seem to find it let page = page.unwrap_or(1); @@ -15,8 +15,12 @@ pub(super) async fn list_rooms( .rooms .metadata .iter_ids() - //.filter(|room_id| async { !exclude_disabled || !self.services.rooms.metadata.is_disabled(room_id).await }) - //.filter(|room_id| async { !exclude_banned || !self.services.rooms.metadata.is_banned(room_id).await }) + .filter_map(|room_id| async move { + (!exclude_disabled || !self.services.rooms.metadata.is_disabled(room_id).await).then_some(room_id) + }) + .filter_map(|room_id| async move { + (!exclude_banned || !self.services.rooms.metadata.is_banned(room_id).await).then_some(room_id) + }) .then(|room_id| get_room_info(self.services, room_id)) .collect::>() .await;