docs(sdk): Add some missing hints for the qrcode feature

master
Damir Jelić 2021-09-10 17:41:33 +02:00
parent 82a99b5267
commit ae0f4c4cc5
2 changed files with 8 additions and 3 deletions

View File

@ -37,6 +37,7 @@ mod sas;
pub use matrix_sdk_base::crypto::{AcceptSettings, CancelInfo};
#[cfg(feature = "qrcode")]
#[cfg_attr(feature = "docs", doc(cfg(qrcode)))]
pub use qrcode::QrVerification;
pub use requests::VerificationRequest;
pub use sas::SasVerification;
@ -47,6 +48,7 @@ pub enum Verification {
/// The `m.sas.v1` verification variant.
SasV1(SasVerification),
#[cfg(feature = "qrcode")]
#[cfg_attr(feature = "docs", doc(cfg(qrcode)))]
/// The `m.qr_code.*.v1` verification variant.
QrV1(QrVerification),
}

View File

@ -85,8 +85,10 @@ impl VerificationRequest {
/// Accept the verification request.
///
/// This method will accept the request and signal that it supports the
/// `m.sas.v1`, the `m.qr_code.show.v1`, and `m.reciprocate.v1` method.
/// This method will accept the request and signal by default that it
/// supports the `m.sas.v1`, the `m.qr_code.show.v1`, and `m.reciprocate.v1`
/// method. If the `qrcode` feature is disabled it will only signal that it
/// supports the `m.sas.v1` method.
///
/// If QR code scanning should be supported or QR code showing shouldn't be
/// supported the [`accept_with_methods()`] method should be used instead.
@ -114,8 +116,9 @@ impl VerificationRequest {
Ok(())
}
#[cfg(feature = "qrcode")]
/// Generate a QR code
#[cfg(feature = "qrcode")]
#[cfg_attr(feature = "docs", doc(cfg(qrcode)))]
pub async fn generate_qr_code(&self) -> Result<Option<QrVerification>> {
Ok(self
.inner