From 67a4a322f56bbb493c8b350fa65017972bd55bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 6 Sep 2024 16:24:43 +0200 Subject: [PATCH] backups: Don't queue up room keys to be downloaded if backups aren't enabled --- crates/matrix-sdk/src/encryption/tasks.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/matrix-sdk/src/encryption/tasks.rs b/crates/matrix-sdk/src/encryption/tasks.rs index c5a43b962..e2c84f417 100644 --- a/crates/matrix-sdk/src/encryption/tasks.rs +++ b/crates/matrix-sdk/src/encryption/tasks.rs @@ -344,6 +344,16 @@ impl BackupDownloadTaskListenerState { return false; }; + // If backups aren't enabled, there's no point in trying to download a room key. + if !client.encryption().backups().are_enabled().await { + debug!( + ?download_request, + "Not performing backup download because backups are not enabled" + ); + + return false; + } + // Check if the keys for this message have arrived in the meantime. // If we get a StoreError doing the lookup, we assume the keys haven't arrived // (though if the store is returning errors, probably something else is