diff --git a/bindings/matrix-sdk-ffi/CHANGELOG.md b/bindings/matrix-sdk-ffi/CHANGELOG.md index c7c0fff73..d05ce17d8 100644 --- a/bindings/matrix-sdk-ffi/CHANGELOG.md +++ b/bindings/matrix-sdk-ffi/CHANGELOG.md @@ -44,6 +44,8 @@ All notable changes to this project will be documented in this file. ### Features +- Add `Client::get_dm_rooms` function to get a list with the DMs for the provided user id. + ([#6487](https://github.com/matrix-org/matrix-rust-sdk/pull/6487)) - Expose `ffi::NotificationRoomInfo::service_members` so clients can use the list of service members to calculate if a room is a DM from the notification info. ([#6474](https://github.com/matrix-org/matrix-rust-sdk/pull/6474)) diff --git a/bindings/matrix-sdk-ffi/src/client.rs b/bindings/matrix-sdk-ffi/src/client.rs index c1951172b..554c8e5af 100644 --- a/bindings/matrix-sdk-ffi/src/client.rs +++ b/bindings/matrix-sdk-ffi/src/client.rs @@ -1483,6 +1483,7 @@ impl Client { Ok(room) } + /// Get the first existing DM room with the given user, if any. pub fn get_dm_room(&self, user_id: String) -> Result>, ClientError> { let user_id = UserId::parse(user_id)?; let sdk_room = self.inner.get_dm_room(&user_id); @@ -1491,6 +1492,7 @@ impl Client { Ok(dm) } + /// Get an iterator with the existing DM rooms for the given user. pub fn get_dm_rooms(&self, user_id: String) -> Result>, ClientError> { let user_id = UserId::parse(user_id)?; let sdk_rooms = self.inner.get_dm_rooms(&user_id); diff --git a/crates/matrix-sdk/CHANGELOG.md b/crates/matrix-sdk/CHANGELOG.md index d49a09fae..35995b230 100644 --- a/crates/matrix-sdk/CHANGELOG.md +++ b/crates/matrix-sdk/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file. ### Features +- Add `Client::get_dm_rooms` function to get an iterator with the DMs for the provided user id. + ([#6487](https://github.com/matrix-org/matrix-rust-sdk/pull/6487)) - Support the stable `m.key_backup` prefix for MSC4287: Sharing key backup preference between clients. ([#6410](https://github.com/matrix-org/matrix-rust-sdk/pull/6410)) diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index 15fa7c282..6f658ce92 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -1796,7 +1796,7 @@ impl Client { self.get_dm_rooms(user_id).next() } - /// Get an iterator with the existing DM rooms with the given user. + /// Get an iterator with the existing DM rooms for the given user. pub fn get_dm_rooms(&self, user_id: &UserId) -> impl Iterator { let rooms = self.joined_rooms();