1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Add method to force re-check of key backup

Also detect when the key backup version changes and do the right
thing

https://github.com/vector-im/riot-web/issues/8524
This commit is contained in:
David Baker
2019-02-13 15:40:07 +00:00
parent 4309749979
commit a087fb37a3
2 changed files with 40 additions and 4 deletions

View File

@@ -849,6 +849,19 @@ MatrixClient.prototype.importRoomKeys = function(keys) {
return this._crypto.importRoomKeys(keys);
};
/**
* Force a re-check of the local key backup status against
* what's on the server.
*
* @returns {Object} Object with backup info (as returned by
* getKeyBackupVersion) in backupInfo and
* trust information (as returned by isKeyBackupTrusted)
* in trustInfo.
*/
MatrixClient.prototype.checkKeyBackup = function() {
return this._crypto.checkKeyBackup();
};
/**
* Get information about the current key backup.
* @returns {Promise} Information object from API or null