Skip to content

Commit abecbf8

Browse files
committed
feat(ffi): add room alias format validation
1 parent b233aa6 commit abecbf8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ mod timeline_event_filter;
3030
mod tracing;
3131
mod utils;
3232
mod widget;
33+
mod room_alias;
3334

3435
use async_compat::TOKIO1 as RUNTIME;
3536
use matrix_sdk::ruma::events::room::{
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use ruma::RoomAliasId;
2+
3+
/// Verifies the passed `String` matches the expected room alias format.
4+
#[matrix_sdk_ffi_macros::export]
5+
fn is_room_alias_format_valid(alias: String) -> bool {
6+
RoomAliasId::parse(alias).is_ok()
7+
}

0 commit comments

Comments
 (0)