You've already forked matrix-js-sdk
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:
@@ -377,22 +377,15 @@ export default class DeviceList {
|
|||||||
/**
|
/**
|
||||||
* Find a device by curve25519 identity key
|
* Find a device by curve25519 identity key
|
||||||
*
|
*
|
||||||
* @param {string} userId owner of the device (optional)
|
|
||||||
* @param {string} algorithm encryption algorithm
|
* @param {string} algorithm encryption algorithm
|
||||||
* @param {string} senderKey curve25519 key to match
|
* @param {string} senderKey curve25519 key to match
|
||||||
*
|
*
|
||||||
* @return {module:crypto/deviceinfo?}
|
* @return {module:crypto/deviceinfo?}
|
||||||
*/
|
*/
|
||||||
getDeviceByIdentityKey(userId, algorithm, senderKey) {
|
getDeviceByIdentityKey(algorithm, senderKey) {
|
||||||
if (arguments.length === 2) {
|
const userId = this._userByIdentityKey[senderKey];
|
||||||
// if userId is omitted, shift the other arguments, and look up the
|
if (!userId) {
|
||||||
// userid
|
return null;
|
||||||
senderKey = algorithm;
|
|
||||||
algorithm = userId;
|
|
||||||
userId = this._userByIdentityKey[senderKey];
|
|
||||||
if (!userId) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -713,7 +713,7 @@ Crypto.prototype.getEventSenderDeviceInfo = function(event) {
|
|||||||
// identity key of the device which set up the Megolm session.
|
// identity key of the device which set up the Megolm session.
|
||||||
|
|
||||||
const device = this._deviceList.getDeviceByIdentityKey(
|
const device = this._deviceList.getDeviceByIdentityKey(
|
||||||
event.getSender(), algorithm, senderKey,
|
algorithm, senderKey,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (device === null) {
|
if (device === null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user