Skip to content

Commit

Permalink
Rename RequestsToJoinListener, fix doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinesp committed Dec 10, 2024
1 parent fe0de31 commit 2b9e330
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bindings/matrix-sdk-ffi/src/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ impl Room {
/// subscription.
pub async fn subscribe_to_join_requests(
self: Arc<Self>,
listener: Box<dyn RequestsToJoinListener>,
listener: Box<dyn JoinRequestsListener>,
) -> Result<Arc<TaskHandle>, ClientError> {
let stream = self.inner.subscribe_to_join_requests().await?;

Expand Down Expand Up @@ -950,7 +950,7 @@ impl From<matrix_sdk::room::request_to_join::JoinRequest> 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<JoinRequest>);
}

Expand Down
8 changes: 6 additions & 2 deletions crates/matrix-sdk/src/room/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<impl Stream<Item = Vec<JoinRequest>>> {
let this = Arc::new(self.clone());

Expand Down

0 comments on commit 2b9e330

Please sign in to comment.