Skip to content

Commit

Permalink
Remove unstable support for m.room_key.withheld (#2512)
Browse files Browse the repository at this point in the history
We no longer send or receive the unstable type.
  • Loading branch information
turt2live authored Jul 13, 2022
1 parent aa130c8 commit 08ab51e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
6 changes: 0 additions & 6 deletions spec/integ/megolm-integ.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {});
Expand Down Expand Up @@ -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, {});
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/crypto/algorithms/megolm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/crypto/algorithms/megolm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/crypto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3119,8 +3119,7 @@ export class Crypto extends TypedEventEmitter<CryptoEvent, CryptoEventHandlerMap
this.secretStorage.onRequestReceived(event);
} else if (event.getType() === "m.secret.send") {
this.secretStorage.onSecretReceived(event);
} else if (event.getType() === "m.room_key.withheld"
|| event.getType() === "org.matrix.room_key.withheld") {
} else if (event.getType() === "m.room_key.withheld") {
this.onRoomKeyWithheldEvent(event);
} else if (event.getContent().transaction_id) {
this.onKeyVerificationMessage(event);
Expand Down

0 comments on commit 08ab51e

Please sign in to comment.