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

use new terminology and field name from MSC

This commit is contained in:
Hubert Chathi
2021-03-15 22:49:43 -04:00
parent a489691151
commit 1c191b2278
5 changed files with 59 additions and 54 deletions

View File

@@ -2292,13 +2292,13 @@ MatrixClient.prototype.deleteKeysFromBackup = function(roomId, sessionId, versio
};
/**
* Share the decryption keys with the given users for the given messages.
* Share shared-history decryption keys with the given users.
*
* @param {string} roomId the room for which keys should be shared.
* @param {array} userIds a list of users to share with. The keys will be sent to
* all of the user's current devices.
*/
MatrixClient.prototype.sendShareableKeys = async function(roomId, userIds) {
MatrixClient.prototype.sendSharedHistoryKeys = async function(roomId, userIds) {
if (this._crypto === null) {
throw new Error("End-to-end encryption disabled");
}
@@ -2317,8 +2317,8 @@ MatrixClient.prototype.sendShareableKeys = async function(roomId, userIds) {
}
const alg = this._crypto._getRoomDecryptor(roomId, roomEncryption.algorithm);
if (alg.sendShareableInboundSessions) {
await alg.sendShareableInboundSessions(devicesByUser);
if (alg.sendSharedHistoryInboundSessions) {
await alg.sendSharedHistoryInboundSessions(devicesByUser);
} else {
logger.warning("Algorithm does not support sharing previous keys", roomEncryption.algorithm);
}