backups: Don't queue up room keys to be downloaded if backups aren't enabled

This commit is contained in:
Damir Jelić
2024-09-06 16:24:43 +02:00
parent 26e6a038a1
commit 67a4a322f5

View File

@@ -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