diff --git a/src/crypto/algorithms/megolm.js b/src/crypto/algorithms/megolm.js index a4eb32ab0..22d98078e 100644 --- a/src/crypto/algorithms/megolm.js +++ b/src/crypto/algorithms/megolm.js @@ -488,6 +488,8 @@ MegolmEncryption.prototype.encryptMessage = function(room, eventType, content) { session_id: session.sessionId, // Include our device ID so that recipients can send us a // m.new_device message if they don't have our session key. + // XXX: Do we still need this now that m.new_device messages + // no longer exist since #483? device_id: self._deviceId, }; @@ -550,12 +552,9 @@ MegolmEncryption.prototype._getDevicesInRoom = async function(room) { // We are happy to use a cached version here: we assume that if we already // have a list of the user's devices, then we already share an e2e room // with them, which means that they will have announced any new devices via - // an m.new_device. - // - // XXX: what if the cache is stale, and the user left the room we had in - // common and then added new devices before joining this one? --Matthew - // - // yup, see https://github.com/vector-im/riot-web/issues/2305 --richvdh + // device_lists in their /sync response. This cache should then be maintained + // using all the device_lists changes and left fields. + // See https://github.com/vector-im/riot-web/issues/2305 for details. const devices = await this._crypto.downloadKeys(roomMembers, false); // remove any blocked devices for (const userId in devices) {