From 3ac598666ae34653f9af01f22e8d3637ea16cc08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 29 May 2024 14:40:22 +0200 Subject: [PATCH] bindings: Remove the InvalidQrCode error variant for the QR login error type. (#3481) We have a separate error for the QR code decoding method. --- bindings/matrix-sdk-ffi/src/client_builder.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/client_builder.rs b/bindings/matrix-sdk-ffi/src/client_builder.rs index 02900ef6f..b25dcee1f 100644 --- a/bindings/matrix-sdk-ffi/src/client_builder.rs +++ b/bindings/matrix-sdk-ffi/src/client_builder.rs @@ -78,8 +78,6 @@ pub enum HumanQrLoginError { Declined, #[error("An unknown error has happened.")] Unknown, - #[error("The QR code we scanned was not valid.")] - InvalidQrCode, #[error("The homeserver doesn't provide a sliding sync proxy in its configuration.")] SlidingSyncNotAvailable, #[error("Unable to use OIDC as the supplied client metadata is invalid.")] @@ -99,6 +97,7 @@ impl From for HumanQrLoginError { LoginFailureReason::UserCancelled => HumanQrLoginError::Cancelled, _ => HumanQrLoginError::Unknown, }, + QRCodeLoginError::Oidc(e) => { if let Some(e) = e.as_request_token_error() { match e { @@ -110,6 +109,7 @@ impl From for HumanQrLoginError { HumanQrLoginError::Unknown } } + QRCodeLoginError::SecureChannel(e) => match e { SecureChannelError::Utf8(_) | SecureChannelError::MessageDecode(_) @@ -492,7 +492,7 @@ impl ClientBuilder { Ok(client) } else { - Err(HumanQrLoginError::InvalidQrCode) + Err(HumanQrLoginError::OtherDeviceNotSignedIn) } } }