From 2ca6a0e91e38d682346c8121b488cc7b1ef372f4 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 4 Jul 2024 19:26:06 +0200 Subject: [PATCH] =?UTF-8?q?ffi:=20remove=20ability=20to=20set=20server=20v?= =?UTF-8?q?ersions=20in=20the=20`ClientBuilder`=20=F0=9F=91=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bindings/matrix-sdk-ffi/src/client_builder.rs | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/client_builder.rs b/bindings/matrix-sdk-ffi/src/client_builder.rs index e66879a6f..c1e9f8711 100644 --- a/bindings/matrix-sdk-ffi/src/client_builder.rs +++ b/bindings/matrix-sdk-ffi/src/client_builder.rs @@ -6,10 +6,7 @@ use matrix_sdk::{ crypto::types::qr_login::{LoginQrCodeDecodeError, QrCodeModeData}, encryption::{BackupDownloadStrategy, EncryptionSettings}, reqwest::Certificate, - ruma::{ - api::{error::UnknownVersionError, MatrixVersion}, - ServerName, UserId, - }, + ruma::{ServerName, UserId}, Client as MatrixClient, ClientBuildError as MatrixClientBuildError, HttpError, IdParseError, RumaApiError, }; @@ -250,7 +247,6 @@ pub struct ClientBuilder { session_path: Option, username: Option, homeserver_cfg: Option, - server_versions: Option>, passphrase: Zeroizing>, user_agent: Option, requires_sliding_sync: bool, @@ -272,7 +268,6 @@ impl ClientBuilder { session_path: None, username: None, homeserver_cfg: None, - server_versions: None, passphrase: Zeroizing::new(None), user_agent: None, requires_sliding_sync: false, @@ -329,12 +324,6 @@ impl ClientBuilder { Arc::new(builder) } - pub fn server_versions(self: Arc, versions: Vec) -> Arc { - let mut builder = unwrap_or_clone_arc(self); - builder.server_versions = Some(versions); - Arc::new(builder) - } - pub fn server_name(self: Arc, server_name: String) -> Arc { let mut builder = unwrap_or_clone_arc(self); builder.homeserver_cfg = Some(HomeserverConfig::ServerName(server_name)); @@ -508,16 +497,6 @@ impl ClientBuilder { inner_builder = inner_builder.user_agent(user_agent); } - if let Some(server_versions) = builder.server_versions { - inner_builder = inner_builder.server_versions( - server_versions - .iter() - .map(|s| MatrixVersion::try_from(s.as_str())) - .collect::, UnknownVersionError>>() - .map_err(|e| ClientBuildError::Generic { message: e.to_string() })?, - ); - } - inner_builder = inner_builder.with_encryption_settings(builder.encryption_settings); if builder.requires_sliding_sync {