From 01656690bcde75f17b9905b5cc92f7e93292605a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 10 Apr 2020 16:18:55 +0200 Subject: [PATCH] crypto: Save the account after an inbound session was created. --- src/crypto/machine.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/crypto/machine.rs b/src/crypto/machine.rs index 0a717857..28dd352e 100644 --- a/src/crypto/machine.rs +++ b/src/crypto/machine.rs @@ -696,9 +696,12 @@ impl OlmMachine { let mut session = match &message { OlmMessage::Message(_) => return Err(OlmError::SessionWedged), OlmMessage::PreKey(m) => { - self.account + let session = self + .account .create_inbound_session(sender_key, m.clone()) - .await? + .await?; + self.store.save_account(self.account.clone()).await?; + session } };