Commit dd001af365

dd001af36502740bb817f0c1508c8aaab7a4c6de

parent: 9732971fc2

Unregistered key

Ulyssa <git@ulyssa.dev> · 2024-03-02 23:55 UTC
committer: <noreply@github.com>

Download rooms keys from backups if they exist (#211)

Layout: unified · split

src/worker.rs +9 −1
@@ -21,6 +21,7 @@ use url::Url;
2121use matrix_sdk::{
2222 config::{RequestConfig, SyncSettings},
2323 encryption::verification::{SasVerification, Verification},
24 encryption::{BackupDownloadStrategy, EncryptionSettings},
2425 event_handler::Ctx,
2526 matrix_auth::MatrixSession,
2627 reqwest,
@@ -101,6 +102,12 @@ use crate::{
101102 ApplicationSettings,
102103};
103104
105const DEFAULT_ENCRYPTION_SETTINGS: EncryptionSettings = EncryptionSettings {
106 auto_enable_cross_signing: true,
107 auto_enable_backups: true,
108 backup_download_strategy: BackupDownloadStrategy::AfterDecryptionFailure,
109};
110
104111const IAMB_DEVICE_NAME: &str = "iamb";
105112const IAMB_USER_AGENT: &str = "iamb";
106113const MIN_MSG_LOAD: u32 = 50;
@@ -664,7 +671,8 @@ async fn create_client_inner(
664671 let builder = Client::builder()
665672 .http_client(http)
666673 .sqlite_store(settings.sqlite_dir.as_path(), None)
667 .request_config(req_config);
674 .request_config(req_config)
675 .with_encryption_settings(DEFAULT_ENCRYPTION_SETTINGS.clone());
668676
669677 let builder = if let Some(url) = homeserver {
670678 // Use the explicitly specified homeserver.