From 95e906e0dc223e08f875b12105d2cc5f23f4eb45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 18 Sep 2020 20:41:14 +0200 Subject: [PATCH] crypto: Save the account if the one-time key count updates. --- matrix_sdk_crypto/src/machine.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/matrix_sdk_crypto/src/machine.rs b/matrix_sdk_crypto/src/machine.rs index 3fb0d8eb..6c0bffcc 100644 --- a/matrix_sdk_crypto/src/machine.rs +++ b/matrix_sdk_crypto/src/machine.rs @@ -1097,6 +1097,10 @@ impl OlmMachine { let count: u64 = one_time_key_count.map_or(0, |c| (*c).into()); self.update_key_count(count); + if let Err(e) = self.store.save_account(self.account.clone()).await { + error!("Error updating the one-time key count {:?}", e); + } + for user_id in &response.device_lists.changed { if let Err(e) = self.identity_manager.mark_user_as_changed(&user_id).await { error!("Error marking a tracked user as changed {:?}", e);