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

Support for exporting megolm session data

This commit is contained in:
Richard van der Hoff
2017-01-14 00:12:21 +00:00
parent 0fa9f7c609
commit 766d8f0ba4
5 changed files with 108 additions and 1 deletions

View File

@@ -461,6 +461,21 @@ MatrixClient.prototype.isRoomEncrypted = function(roomId) {
return this._crypto.isRoomEncrypted(roomId);
};
/**
* Get a list containing all of the room keys
*
* This should be encrypted before returning it to the user.
*
* @return {module:client.Promise} a promise which resolves to a list of
* session export objects
*/
MatrixClient.prototype.exportRoomKeys = function() {
if (!this._crypto) {
return q.reject(new Error("End-to-end encryption disabled"));
}
return this._crypto.exportRoomKeys();
};
/**
* Decrypt a received event according to the algorithm specified in the event.
*