feat(bindings): added join room by id to ffi

feat(bindings): added join room by id to ffi
This commit is contained in:
Ivan Enderlin
2024-03-21 12:18:33 +01:00
committed by GitHub

View File

@@ -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)]