From 0a9959bffb04fc9b5d2d17490ba47fd832260721 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Sat, 11 Jan 2020 15:49:01 -0500 Subject: [PATCH] use a separate object for each encrypted content so that we don't duplicate the ciphertext for everyone --- src/crypto/algorithms/megolm.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/crypto/algorithms/megolm.js b/src/crypto/algorithms/megolm.js index 909211d6a..911f2311d 100644 --- a/src/crypto/algorithms/megolm.js +++ b/src/crypto/algorithms/megolm.js @@ -460,15 +460,15 @@ MegolmEncryption.prototype._splitBlockedDevices = function(devicesByUser) { MegolmEncryption.prototype._encryptAndSendKeysToDevices = function( session, chainIndex, userDeviceMap, payload, ) { - const encryptedContent = { - algorithm: olmlib.OLM_ALGORITHM, - sender_key: this._olmDevice.deviceCurve25519Key, - ciphertext: {}, - }; const contentMap = {}; const promises = []; for (let i = 0; i < userDeviceMap.length; i++) { + const encryptedContent = { + algorithm: olmlib.OLM_ALGORITHM, + sender_key: this._olmDevice.deviceCurve25519Key, + ciphertext: {}, + }; const val = userDeviceMap[i]; const userId = val.userId; const deviceInfo = val.deviceInfo;