You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-19 10:22:30 +03:00
Improve decryption error messages
Attempt to make the decryption errors less obscure
This commit is contained in:
@@ -467,7 +467,7 @@ MatrixClient.prototype.isRoomEncrypted = function(roomId) {
|
||||
*/
|
||||
function _decryptEvent(client, event) {
|
||||
if (!client._crypto) {
|
||||
_badEncryptedMessage(event, "**Encryption not enabled**");
|
||||
_badEncryptedMessage(event, "Encryption not enabled");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ function _decryptEvent(client, event) {
|
||||
if (!(e instanceof Crypto.DecryptionError)) {
|
||||
throw e;
|
||||
}
|
||||
_badEncryptedMessage(event, "**" + e.message + "**");
|
||||
_badEncryptedMessage(event, e.message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -487,7 +487,7 @@ function _badEncryptedMessage(event, reason) {
|
||||
type: "m.room.message",
|
||||
content: {
|
||||
msgtype: "m.bad.encrypted",
|
||||
body: reason,
|
||||
body: "** Unable to decrypt: " + reason + " **",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user