From b0204ab54efa67d0c157fe77eb0633a21edca359 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Thu, 24 Sep 2020 17:41:08 -0400 Subject: [PATCH] use unstable prefix --- src/crypto/index.js | 2 +- src/sync.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/crypto/index.js b/src/crypto/index.js index a69b4e08e..dc87f91ef 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -1959,7 +1959,7 @@ async function _uploadOneTimeKeys(crypto) { const res = await crypto._baseApis.uploadKeysRequest({ one_time_keys: oneTimeJson, - fallback_keys: fallbackJson, + "org.matrix.msc2732.fallback_keys": fallbackJson, }); await crypto._olmDevice.markKeysAsPublished(); diff --git a/src/sync.js b/src/sync.js index b87b3e0e8..3f9ded684 100644 --- a/src/sync.js +++ b/src/sync.js @@ -1361,13 +1361,14 @@ SyncApi.prototype._processSyncResponse = async function( const currentCount = data.device_one_time_keys_count.signed_curve25519 || 0; this.opts.crypto.updateOneTimeKeyCount(currentCount); } - if (this.opts.crypto && data.device_unused_fallback_keys) { + if (this.opts.crypto && data["org.matrix.msc2732.device_unused_fallback_keys"]) { // The presence of device_unused_fallback_keys indicates that the // server supports fallback keys. If there's no unused // signed_curve25519 fallback key we need a new one. + const unused_fallback_keys = data["org.matrix.msc2732.device_unused_fallback_keys"]; this.opts.crypto.setNeedsNewFallback( - data.device_unused_fallback_keys instanceof Array && - !data.device_unused_fallback_keys.includes("signed_curve25519"), + unused_fallback_keys instanceof Array && + !unused_fallback_keys.includes("signed_curve25519"), ); } };