From b9e31fd5b0892ea6575e301fbb3b51972599ecbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Mon, 11 Nov 2024 12:16:01 +0100 Subject: [PATCH] feat(ffi): Add `Client::create_room_alias` function --- bindings/matrix-sdk-ffi/src/client.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bindings/matrix-sdk-ffi/src/client.rs b/bindings/matrix-sdk-ffi/src/client.rs index d46a910818..e93067bcc2 100644 --- a/bindings/matrix-sdk-ffi/src/client.rs +++ b/bindings/matrix-sdk-ffi/src/client.rs @@ -1141,6 +1141,17 @@ impl Client { let alias = RoomAliasId::parse(alias)?; self.inner.is_room_alias_available(&alias).await.map_err(Into::into) } + + /// Creates a new room alias associated with the provided room id. + pub async fn create_room_alias( + &self, + room_alias: String, + room_id: String, + ) -> Result<(), ClientError> { + let room_alias = RoomAliasId::parse(room_alias)?; + let room_id = RoomId::parse(room_id)?; + self.inner.create_room_alias(&room_alias, &room_id).await.map_err(Into::into) + } } #[matrix_sdk_ffi_macros::export(callback_interface)]