1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Fix all megolm error reported as unknown (#8916)

* Fix all megolm error reported as unknown

* code review

* bad paste in comment
This commit is contained in:
Valere
2022-06-30 09:55:05 +02:00
committed by GitHub
parent 4eab0deeb3
commit f137bf3fd3
3 changed files with 13 additions and 5 deletions

View File

@ -22,13 +22,16 @@ class MockDecryptionError extends Error {
constructor(code) {
super();
this.errcode = code || 'MOCK_DECRYPTION_ERROR';
this.code = code || 'MOCK_DECRYPTION_ERROR';
}
}
function createFailedDecryptionEvent() {
const event = new MatrixEvent({
event_id: "event-id-" + Math.random().toString(16).slice(2),
content: {
algorithm: "m.megolm.v1.aes-sha2",
},
});
event.setClearData(event.badEncryptedMessage(":("));
return event;