diff --git a/bindings/matrix-sdk-ffi/src/room_list.rs b/bindings/matrix-sdk-ffi/src/room_list.rs index 5248c434b..98cd82f8b 100644 --- a/bindings/matrix-sdk-ffi/src/room_list.rs +++ b/bindings/matrix-sdk-ffi/src/room_list.rs @@ -124,14 +124,16 @@ impl RoomListService { }))) } - async fn all_rooms(&self) -> Result, RoomListError> { + async fn all_rooms(self: Arc) -> Result, RoomListError> { Ok(Arc::new(RoomList { + room_list_service: self.clone(), inner: Arc::new(self.inner.all_rooms().await.map_err(RoomListError::from)?), })) } - async fn invites(&self) -> Result, RoomListError> { + async fn invites(self: Arc) -> Result, RoomListError> { Ok(Arc::new(RoomList { + room_list_service: self.clone(), inner: Arc::new(self.inner.invites().await.map_err(RoomListError::from)?), })) } @@ -151,6 +153,7 @@ impl RoomListService { #[derive(uniffi::Object)] pub struct RoomList { + room_list_service: Arc, inner: Arc, } @@ -173,6 +176,10 @@ impl RoomList { }))), }) } + + fn room(&self, room_id: String) -> Result, RoomListError> { + self.room_list_service.room(room_id) + } } #[derive(uniffi::Record)]