You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
MatrixClient.getStoredDevicesForUser
Implement MatrixClient.getStoredDevicesForUser which uses Crypto.getStoredDevicesForUser, which is more powerful than listDeviceKeys, and isn't deprecated. Also a couple of accessors for DeviceInfo.
This commit is contained in:
@@ -308,6 +308,8 @@ MatrixClient.prototype.downloadKeys = function(userIds, forceDownload) {
|
||||
/**
|
||||
* List the stored device keys for a user id
|
||||
*
|
||||
* @deprecated prefer {@link module:client#getStoredDevicesForUser}
|
||||
*
|
||||
* @param {string} userId the user to list keys for.
|
||||
*
|
||||
* @return {object[]} list of devices with "id", "verified", "blocked",
|
||||
@@ -320,6 +322,22 @@ MatrixClient.prototype.listDeviceKeys = function(userId) {
|
||||
return this._crypto.listDeviceKeys(userId);
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the stored device keys for a user id
|
||||
*
|
||||
* @param {string} userId the user to list keys for.
|
||||
*
|
||||
* @return {module:crypto-deviceinfo[]} list of devices
|
||||
*/
|
||||
MatrixClient.prototype.getStoredDevicesForUser = function(userId) {
|
||||
if (this._crypto === null) {
|
||||
throw new Error("End-to-end encryption disabled");
|
||||
}
|
||||
return this._crypto.getStoredDevicesForUser(userId);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Mark the given device as verified
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user