Skip to content

Commit a2ac707

Browse files
committed
Merge #2549
...onto group call branch This commit just has the merge with encryptAndSendKeysToDevices converted, but not other calls yet.
1 parent b711781 commit a2ac707

17 files changed

+754
-72
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"jest-localstorage-mock": "^2.4.6",
105105
"jest-sonar-reporter": "^2.0.0",
106106
"jsdoc": "^3.6.6",
107-
"matrix-mock-request": "^2.1.0",
107+
"matrix-mock-request": "^2.1.1",
108108
"rimraf": "^3.0.2",
109109
"terser": "^5.5.1",
110110
"tsify": "^5.0.2",

spec/unit/crypto/algorithms/megolm.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe("MegolmDecryption", function() {
5959
mockBaseApis = {
6060
claimOneTimeKeys: jest.fn(),
6161
sendToDevice: jest.fn(),
62+
queueToDevice: jest.fn(),
6263
} as unknown as MockedObject<MatrixClient>;
6364

6465
const cryptoStore = new MemoryCryptoStore();
@@ -179,6 +180,7 @@ describe("MegolmDecryption", function() {
179180
});
180181

181182
mockBaseApis.sendToDevice.mockReset();
183+
mockBaseApis.queueToDevice.mockReset();
182184

183185
// do the share
184186
megolmDecryption.shareKeysWithDevice(keyRequest);
@@ -324,6 +326,7 @@ describe("MegolmDecryption", function() {
324326
},
325327
});
326328
mockBaseApis.sendToDevice.mockResolvedValue(undefined);
329+
mockBaseApis.queueToDevice.mockResolvedValue(undefined);
327330

328331
aliceDeviceInfo = {
329332
deviceId: 'aliceDevice',
@@ -410,7 +413,7 @@ describe("MegolmDecryption", function() {
410413
expect(mockCrypto.downloadKeys).toHaveBeenCalledWith(
411414
['@alice:home.server'], false,
412415
);
413-
expect(mockBaseApis.sendToDevice).toHaveBeenCalled();
416+
expect(mockBaseApis.queueToDevice).toHaveBeenCalled();
414417
expect(mockBaseApis.claimOneTimeKeys).toHaveBeenCalledWith(
415418
[['@alice:home.server', 'aliceDevice']], 'signed_curve25519', 2000,
416419
);
@@ -453,15 +456,15 @@ describe("MegolmDecryption", function() {
453456
'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWI',
454457
);
455458

456-
mockBaseApis.sendToDevice.mockClear();
459+
mockBaseApis.queueToDevice.mockClear();
457460
await megolmEncryption.reshareKeyWithDevice(
458461
olmDevice.deviceCurve25519Key,
459462
ct1.session_id,
460463
'@alice:home.server',
461464
aliceDeviceInfo,
462465
);
463466

464-
expect(mockBaseApis.sendToDevice).not.toHaveBeenCalled();
467+
expect(mockBaseApis.queueToDevice).not.toHaveBeenCalled();
465468
});
466469
});
467470
});

0 commit comments

Comments
 (0)