From ce24b509cf9705fdf0c106f9ae45841ad41aeb30 Mon Sep 17 00:00:00 2001 From: strawberry Date: Sat, 20 Jan 2024 19:51:39 -0500 Subject: [PATCH] return joined member count of room for pushrules instead of hardcoded 10 im not sure what the TODO is trying to say here, but since it's many years old and conduwuit is fast, i dont see an issue with this. Signed-off-by: strawberry --- src/service/pusher/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/service/pusher/mod.rs b/src/service/pusher/mod.rs index 015e3698..d3053ca7 100644 --- a/src/service/pusher/mod.rs +++ b/src/service/pusher/mod.rs @@ -200,7 +200,13 @@ impl Service { let ctx = PushConditionRoomCtx { room_id: room_id.to_owned(), - member_count: 10_u32.into(), // TODO: get member count efficiently + member_count: UInt::from( + services() + .rooms + .state_cache + .room_joined_count(room_id)? + .unwrap_or(1) as u32, + ), user_id: user.to_owned(), user_display_name: services() .users