crytpo: Get the one-time keys count out of the sync response as well.
This commit is contained in:
parent
8867b198f7
commit
545ebe8d9c
2 changed files with 10 additions and 3 deletions
|
@ -302,9 +302,9 @@ impl Client {
|
|||
|
||||
#[cfg(feature = "encryption")]
|
||||
{
|
||||
let olm = self.olm.lock().await;
|
||||
let mut olm = self.olm.lock().await;
|
||||
|
||||
if let Some(o) = &*olm {
|
||||
if let Some(o) = &mut *olm {
|
||||
o.receive_sync_response(response);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -336,7 +336,14 @@ impl OlmMachine {
|
|||
// TODO handle to-device verification events here.
|
||||
}
|
||||
|
||||
pub fn receive_sync_response(&self, response: &mut SyncResponse) {
|
||||
pub fn receive_sync_response(&mut self, response: &mut SyncResponse) {
|
||||
let one_time_key_count = response
|
||||
.device_one_time_keys_count
|
||||
.get(&keys::KeyAlgorithm::SignedCurve25519);
|
||||
|
||||
let count: u64 = one_time_key_count.map_or(0, |c| (*c).into());
|
||||
self.uploaded_signed_key_count = Some(count);
|
||||
|
||||
for event in response.to_device.events.iter() {
|
||||
let event = if let EventResult::Ok(e) = event {
|
||||
e
|
||||
|
|
Loading…
Reference in a new issue