From 2b9e3302a1a86ce923b7d4387f44bc46e47fb37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Tue, 10 Dec 2024 13:12:06 +0100 Subject: [PATCH] Rename `RequestsToJoinListener`, fix doc comment --- bindings/matrix-sdk-ffi/src/room.rs | 4 ++-- crates/matrix-sdk/src/room/mod.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/room.rs b/bindings/matrix-sdk-ffi/src/room.rs index b834e668659..2665c38fa78 100644 --- a/bindings/matrix-sdk-ffi/src/room.rs +++ b/bindings/matrix-sdk-ffi/src/room.rs @@ -917,7 +917,7 @@ impl Room { /// subscription. pub async fn subscribe_to_join_requests( self: Arc, - listener: Box, + listener: Box, ) -> Result, ClientError> { let stream = self.inner.subscribe_to_join_requests().await?; @@ -950,7 +950,7 @@ impl From for JoinRequest { /// A listener for receiving new requests to a join a room. #[matrix_sdk_ffi_macros::export(callback_interface)] -pub trait RequestsToJoinListener: Send + Sync { +pub trait JoinRequestsListener: Send + Sync { fn call(&self, join_requests: Vec); } diff --git a/crates/matrix-sdk/src/room/mod.rs b/crates/matrix-sdk/src/room/mod.rs index 640a4f29ef1..c4dab680df4 100644 --- a/crates/matrix-sdk/src/room/mod.rs +++ b/crates/matrix-sdk/src/room/mod.rs @@ -3208,8 +3208,12 @@ impl Room { ObservableLiveLocation::new(&self.client, self.room_id()) } - /// Helper to requests to join this `Room`. It returns both a list with the - /// initial items and any new request to join received. + /// Helper to requests to join this `Room`. + /// + /// The current requests to join the room will be emitted immediately + /// when subscribing. When a new membership event is received, a request is + /// marked as seen or there is a limited sync, a new set of requests + /// will be emitted. pub async fn subscribe_to_join_requests(&self) -> Result>> { let this = Arc::new(self.clone());