mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-08 16:04:13 -04:00
feat(bindings): added join room by id to ffi
feat(bindings): added join room by id to ffi
This commit is contained in:
@@ -32,7 +32,7 @@ use matrix_sdk::{
|
||||
AnyInitialStateEvent, AnyToDeviceEvent, InitialStateEvent,
|
||||
},
|
||||
serde::Raw,
|
||||
EventEncryptionAlgorithm, TransactionId, UInt, UserId,
|
||||
EventEncryptionAlgorithm, RoomId, TransactionId, UInt, UserId,
|
||||
},
|
||||
AuthApi, AuthSession, Client as MatrixClient, SessionChange, SessionTokens,
|
||||
};
|
||||
@@ -751,6 +751,12 @@ impl Client {
|
||||
matrix_sdk::room_directory_search::RoomDirectorySearch::new((*self.inner).clone()),
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn join_room_by_id(&self, room_id: String) -> Result<Arc<Room>, ClientError> {
|
||||
let room_id = RoomId::parse(room_id)?;
|
||||
let room = self.inner.join_room_by_id(room_id.as_ref()).await?;
|
||||
Ok(Arc::new(Room::new(room)))
|
||||
}
|
||||
}
|
||||
|
||||
#[uniffi::export(callback_interface)]
|
||||
|
||||
Reference in New Issue
Block a user