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..9d61606a6b0 100644 --- a/crates/matrix-sdk/src/room/mod.rs +++ b/crates/matrix-sdk/src/room/mod.rs @@ -3208,8 +3208,14 @@ 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, along with a [`TaskHandle`] to cancel the + /// subscription. + /// + /// 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());