diff --git a/src/crypto/DeviceList.js b/src/crypto/DeviceList.js index 417aa0dfb..57bc74a4f 100644 --- a/src/crypto/DeviceList.js +++ b/src/crypto/DeviceList.js @@ -377,22 +377,15 @@ export default class DeviceList { /** * Find a device by curve25519 identity key * - * @param {string} userId owner of the device (optional) * @param {string} algorithm encryption algorithm * @param {string} senderKey curve25519 key to match * * @return {module:crypto/deviceinfo?} */ - getDeviceByIdentityKey(userId, algorithm, senderKey) { - if (arguments.length === 2) { - // if userId is omitted, shift the other arguments, and look up the - // userid - senderKey = algorithm; - algorithm = userId; - userId = this._userByIdentityKey[senderKey]; - if (!userId) { - return null; - } + getDeviceByIdentityKey(algorithm, senderKey) { + const userId = this._userByIdentityKey[senderKey]; + if (!userId) { + return null; } if ( diff --git a/src/crypto/index.js b/src/crypto/index.js index 3918ec862..97244f7b3 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -713,7 +713,7 @@ Crypto.prototype.getEventSenderDeviceInfo = function(event) { // identity key of the device which set up the Megolm session. const device = this._deviceList.getDeviceByIdentityKey( - event.getSender(), algorithm, senderKey, + algorithm, senderKey, ); if (device === null) {