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:
parent
4eab0deeb3
commit
f137bf3fd3
3 changed files with 13 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue