1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Change getDeviceByIdentityKey() to just the 2 arg version

This commit is contained in:
David Baker
2018-10-31 18:31:56 +00:00
parent f5846b89ea
commit 6de213483c
2 changed files with 5 additions and 12 deletions

View File

@@ -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 (