From 916bf69e5c7630d63ffc6be9ceb1316efbec771f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 30 Nov 2023 16:01:54 +0100 Subject: [PATCH] Enable backups and set the backup download strategy for the bindings --- bindings/matrix-sdk-ffi/src/client_builder.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bindings/matrix-sdk-ffi/src/client_builder.rs b/bindings/matrix-sdk-ffi/src/client_builder.rs index 918e984f7..07fd177c4 100644 --- a/bindings/matrix-sdk-ffi/src/client_builder.rs +++ b/bindings/matrix-sdk-ffi/src/client_builder.rs @@ -1,6 +1,7 @@ use std::{fs, path::PathBuf, sync::Arc}; use matrix_sdk::{ + encryption::{BackupDownloadStrategy, EncryptionSettings}, ruma::{ api::{error::UnknownVersionError, MatrixVersion}, ServerName, UserId, @@ -249,6 +250,13 @@ impl ClientBuilder { impl Default for ClientBuilder { fn default() -> Self { + let encryption_settings = EncryptionSettings { + auto_enable_cross_signing: true, + auto_enable_backups: true, + backup_download_strategy: BackupDownloadStrategy::AfterDecryptionFailure, + }; + let inner = MatrixClient::builder().with_encryption_settings(encryption_settings); + Self { base_path: None, username: None, @@ -261,7 +269,7 @@ impl Default for ClientBuilder { proxy: None, disable_ssl_verification: false, disable_automatic_token_refresh: false, - inner: MatrixClient::builder(), + inner, cross_process_refresh_lock_id: None, session_delegate: None, }