You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Make a start on a unit test for megolm alg impl
not much here yet, but it's a start at least.
This commit is contained in:
@@ -520,6 +520,9 @@ function MegolmDecryption(params) {
|
||||
// events which we couldn't decrypt due to unknown sessions / indexes: map from
|
||||
// senderKey|sessionId to list of MatrixEvents
|
||||
this._pendingEvents = {};
|
||||
|
||||
// this gets stubbed out by the unit tests.
|
||||
this.olmlib = olmlib;
|
||||
}
|
||||
utils.inherits(MegolmDecryption, base.DecryptionAlgorithm);
|
||||
|
||||
@@ -698,7 +701,7 @@ MegolmDecryption.prototype.shareKeysWithDevice = function(keyRequest) {
|
||||
const deviceInfo = this._crypto.getStoredDevice(userId, deviceId);
|
||||
const body = keyRequest.requestBody;
|
||||
|
||||
olmlib.ensureOlmSessionsForDevices(
|
||||
this.olmlib.ensureOlmSessionsForDevices(
|
||||
this._olmDevice, this._baseApis, {
|
||||
[userId]: [deviceInfo],
|
||||
},
|
||||
@@ -741,7 +744,7 @@ MegolmDecryption.prototype.shareKeysWithDevice = function(keyRequest) {
|
||||
ciphertext: {},
|
||||
};
|
||||
|
||||
olmlib.encryptMessageForDevice(
|
||||
this.olmlib.encryptMessageForDevice(
|
||||
encryptedContent.ciphertext,
|
||||
this._userId,
|
||||
this._deviceId,
|
||||
|
||||
Reference in New Issue
Block a user