1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Add MatrixEvent.isDecryptionFailure()

This commit is contained in:
Richard van der Hoff
2017-08-24 13:32:19 +01:00
parent 033babfbfc
commit ee5b8748b5

View File

@@ -318,6 +318,19 @@ utils.extend(module.exports.MatrixEvent.prototype, {
return this._decryptionPromise != null;
},
/**
* Check if this event is an encrypted event which we failed to decrypt
*
* (This implies that we might retry decryption at some point in the future)
*
* @return {boolean} True if this event is an encrypted event which we
* couldn't decrypt.
*/
isDecryptionFailure: function() {
return this._clearEvent && this._clearEvent.content &&
this._clearEvent.content.msgtype === "m.bad.encrypted";
},
/**
* Start the process of trying to decrypt this event.
*