Browse Source

fix(key_value): return a map of algorithms instead of key ids for count_one_time_keys

this regession was introduced in 2a7aa6242f
merge-requests/762/head
Matthias Ahouansou 10 months ago
parent
commit
45861f8e4a
No known key found for this signature in database
  1. 3
      src/database/key_value/users.rs

3
src/database/key_value/users.rs

@ -406,11 +406,12 @@ impl service::users::Data for KeyValueDatabase {
self.onetimekeyid_onetimekeys
.scan_prefix(userdeviceid)
.map(|(bytes, _)| {
serde_json::from_slice::<OneTimeKeyAlgorithm>(
serde_json::from_slice::<OwnedOneTimeKeyId>(
bytes.rsplit(|&b| b == 0xff).next().ok_or_else(|| {
Error::bad_database("OneTimeKey ID in db is invalid.")
})?,
)
.map(|key_id| key_id.algorithm())
.map_err(|_| Error::bad_database("DeviceKeyId in db is invalid."))
})
{

Loading…
Cancel
Save