From 08ab51eeac2419d9a10e6df4f9ca020db6e6f025 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 13 Jul 2022 08:56:01 -0600 Subject: [PATCH] Remove unstable support for `m.room_key.withheld` (#2512) We no longer send or receive the unstable type. --- spec/integ/megolm-integ.spec.js | 6 ------ spec/unit/crypto/algorithms/megolm.spec.js | 4 ++-- src/crypto/algorithms/megolm.ts | 1 - src/crypto/index.ts | 3 +-- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/spec/integ/megolm-integ.spec.js b/spec/integ/megolm-integ.spec.js index 3e4cdbe51..93101a376 100644 --- a/spec/integ/megolm-integ.spec.js +++ b/spec/integ/megolm-integ.spec.js @@ -615,9 +615,6 @@ describe("megolm", function() { ).respond(200, { event_id: '$event_id', }); - aliceTestClient.httpBackend.when( - 'PUT', '/sendToDevice/org.matrix.room_key.withheld/', - ).respond(200, {}); aliceTestClient.httpBackend.when( 'PUT', '/sendToDevice/m.room_key.withheld/', ).respond(200, {}); @@ -718,9 +715,6 @@ describe("megolm", function() { event_id: '$event_id', }; }); - aliceTestClient.httpBackend.when( - 'PUT', '/sendToDevice/org.matrix.room_key.withheld/', - ).respond(200, {}); aliceTestClient.httpBackend.when( 'PUT', '/sendToDevice/m.room_key.withheld/', ).respond(200, {}); diff --git a/spec/unit/crypto/algorithms/megolm.spec.js b/spec/unit/crypto/algorithms/megolm.spec.js index aa603b049..9bb401b4d 100644 --- a/spec/unit/crypto/algorithms/megolm.spec.js +++ b/spec/unit/crypto/algorithms/megolm.spec.js @@ -643,7 +643,7 @@ describe("MegolmDecryption", function() { const roomId = "!someroom"; aliceClient.crypto.onToDeviceEvent(new MatrixEvent({ - type: "org.matrix.room_key.withheld", + type: "m.room_key.withheld", sender: "@bob:example.com", content: { algorithm: "m.megolm.v1.aes-sha2", @@ -718,7 +718,7 @@ describe("MegolmDecryption", function() { const now = Date.now(); aliceClient.crypto.onToDeviceEvent(new MatrixEvent({ - type: "org.matrix.room_key.withheld", + type: "m.room_key.withheld", sender: "@bob:example.com", content: { algorithm: "m.megolm.v1.aes-sha2", diff --git a/src/crypto/algorithms/megolm.ts b/src/crypto/algorithms/megolm.ts index f1ab0ee71..c16187fd6 100644 --- a/src/crypto/algorithms/megolm.ts +++ b/src/crypto/algorithms/megolm.ts @@ -738,7 +738,6 @@ class MegolmEncryption extends EncryptionAlgorithm { contentMap[userId][deviceId] = message; } - await this.baseApis.sendToDevice("org.matrix.room_key.withheld", contentMap); await this.baseApis.sendToDevice("m.room_key.withheld", contentMap); // record the fact that we notified these blocked devices diff --git a/src/crypto/index.ts b/src/crypto/index.ts index 6c3436854..afa5c4b8a 100644 --- a/src/crypto/index.ts +++ b/src/crypto/index.ts @@ -3119,8 +3119,7 @@ export class Crypto extends TypedEventEmitter