You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Add in a public api getStoredDevice allowing clients to get a specific device
Signed-off-by: Kit Sczudlo <kit@kitscz.com>
This commit is contained in:
@@ -359,6 +359,21 @@ MatrixClient.prototype.getStoredDevicesForUser = function(userId) {
|
||||
return this._crypto.getStoredDevicesForUser(userId) || [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the stored device key for a user id and device id
|
||||
*
|
||||
* @param {string} userId the user to list keys for.
|
||||
* @param {string} deviceId unique identifier for the device
|
||||
*
|
||||
* @return {?module:crypto-deviceinfo} device or null
|
||||
*/
|
||||
MatrixClient.prototype.getStoredDevice = function(userId, deviceId) {
|
||||
if (this._crypto === null) {
|
||||
throw new Error("End-to-end encryption disabled");
|
||||
}
|
||||
return this._crypto.getStoredDevice(userId, deviceId) || null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Mark the given device as verified
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user