Skip to content

Commit

Permalink
feat(ffi): Add Client::create_room_alias function
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinesp committed Nov 11, 2024
1 parent 02094bf commit b9e31fd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bindings/matrix-sdk-ffi/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit b9e31fd

Please sign in to comment.