WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 5f63786

Browse files
committed
change: updated function name and added the pr link to the changelog
1 parent 0c78ff7 commit 5f63786

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

bindings/matrix-sdk-ffi/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ All notable changes to this project will be documented in this file.
88

99
### Features
1010

11-
- Add `SpaceService::space_room_for_id` to get a space given its id from the space graph if available.
11+
- Add `SpaceService::get_space_room` to get a space given its id from the space graph if available.
12+
[#5944](https://github.com/matrix-org/matrix-rust-sdk/pull/5944)
1213
- Add `QrCodeData::to_bytes()` to allow generation of a QR code.
1314
([#5939](https://github.com/matrix-org/matrix-rust-sdk/pull/5939))
1415
- [**breaking**]: The new Latest Event API replaces the old API.

bindings/matrix-sdk-ffi/src/spaces.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,9 @@ impl SpaceService {
110110

111111
/// Returns the corresponding `SpaceRoom` for the given room ID, or `None`
112112
/// if it isn't known.
113-
pub async fn space_room_for_id(
114-
&self,
115-
room_id: String,
116-
) -> Result<Option<SpaceRoom>, ClientError> {
113+
pub async fn get_space_room(&self, room_id: String) -> Result<Option<SpaceRoom>, ClientError> {
117114
let room_id = RoomId::parse(room_id.as_str())?;
118-
Ok(self.inner.space_room_for_id(&room_id).await.map(Into::into))
115+
Ok(self.inner.get_space_room(&room_id).await.map(Into::into))
119116
}
120117

121118
pub async fn add_child_to_space(

crates/matrix-sdk-ui/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ All notable changes to this project will be documented in this file.
88

99
### Features
1010

11-
- Add `SpaceService::space_room_for_id` to get a space given its id from the space graph if available.
11+
- Add `SpaceService::get_space_room` to get a space given its id from the space graph if available.
12+
[#5944](https://github.com/matrix-org/matrix-rust-sdk/pull/5944)
1213
- [**breaking**]: The new Latest Event API replaces the old API. All the
1314
`new_` prefixes have been removed. The following methods are removed:
1415
`EventTimelineItem::from_latest_event`, and `Timeline::latest_event`. See the

crates/matrix-sdk-ui/src/spaces/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ impl SpaceService {
259259

260260
/// Returns the corresponding `SpaceRoom` for the given room ID, or `None`
261261
/// if it isn't known.
262-
pub async fn space_room_for_id(&self, room_id: &RoomId) -> Option<SpaceRoom> {
262+
pub async fn get_space_room(&self, room_id: &RoomId) -> Option<SpaceRoom> {
263263
let graph = &self.space_state.lock().await.graph;
264264

265265
if graph.has_node(room_id)
@@ -909,7 +909,7 @@ mod tests {
909909
}
910910

911911
#[async_test]
912-
async fn test_space_room_for_id() {
912+
async fn test_get_space_room_for_id() {
913913
let server = MatrixMockServer::new().await;
914914
let client = server.client_builder().build().await;
915915
let user_id = client.user_id().unwrap();
@@ -939,7 +939,7 @@ mod tests {
939939
// Ensure internal state is populated.
940940
_ = space_service.joined_spaces().await;
941941

942-
let found = space_service.space_room_for_id(space_id).await;
942+
let found = space_service.get_space_room(space_id).await;
943943
assert!(found.is_some());
944944

945945
let expected = SpaceRoom::new_from_known(&client.get_room(space_id).unwrap(), 0);

0 commit comments

Comments
 (0)