-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ffi): add room display name to room alias transformation
- Loading branch information
1 parent
d0d4c58
commit c19a12a
Showing
5 changed files
with
76 additions
and
13 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
use matrix_sdk::DisplayName; | ||
use ruma::RoomAliasId; | ||
|
||
/// Verifies the passed `String` matches the expected room alias format. | ||
#[matrix_sdk_ffi_macros::export] | ||
fn is_room_alias_format_valid(alias: String) -> bool { | ||
RoomAliasId::parse(alias).is_ok() | ||
} | ||
} | ||
|
||
/// Transforms a Room's display name into a valid room alias name. | ||
#[matrix_sdk_ffi_macros::export] | ||
fn room_alias_name_from_room_display_name(room_name: String) -> String { | ||
DisplayName::Named(room_name).to_room_alias_name() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters