You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-08 19:08:34 +03:00
Expose the clear event content directly from an event
This commit is contained in:
@@ -519,6 +519,17 @@ utils.extend(module.exports.MatrixEvent.prototype, {
|
||||
decryptionResult.forwardingCurve25519KeyChain || [];
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the cleartext content for this event. If the event is not encrypted,
|
||||
* or encryption has not been completed, this will return null.
|
||||
*
|
||||
* @returns {Object} The cleartext (decrypted) content for the event
|
||||
*/
|
||||
getClearContent: function() {
|
||||
const ev = this._clearEvent;
|
||||
return ev && ev.content ? ev.content : null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the event is encrypted.
|
||||
* @return {boolean} True if this event is encrypted.
|
||||
|
||||
Reference in New Issue
Block a user