Add init_transports() API

This commit is contained in:
Hocuri
2026-09-17 18:20:34 +02:00
parent 44c2febbe1
commit d5d8876b62
6 changed files with 152 additions and 16 deletions
+12
View File
@@ -525,6 +525,18 @@ impl CommandApi {
ctx.add_transport_from_qr(&qr).await
}
/// Automatically adds up to three transports.
///
/// If the user just scanned a QR code of type `Account`, `Login`,
/// `AskVerifyContact`, `AskVerifyGroup`, or `AskJoinBroadcast`,
/// then UI implementations should pass it as the `qr` parameter.
/// The host(s) from the QR code will then also be considered
/// for creating an account there.
async fn init_transports(&self, account_id: u32, qr: Option<String>) -> Result<()> {
let ctx = self.get_context(account_id).await?;
ctx.init_transports(qr.as_deref()).await
}
/// Returns the list of all email accounts that are used as a transport in the current profile.
/// Use [Self::add_or_update_transport()] to add or change a transport
/// and [Self::delete_transport()] to remove a transport.