matrix-js-sdk
2e4a8f4f - Change how MatrixEvent manages encrypted events

Commit
9 years ago
Change how MatrixEvent manages encrypted events Make `MatrixEvent.event` contain the *encrypted* event, and keep the plaintext payload in a separate `_clearEvent` property. This achieves several aims: * means that we have a record of the actual object which was received over the wire, which can be shown by clients for 'view source'. * makes sent and received encrypted MatrixEvents more consistent (previously sent ones had `encryptedType` and `encryptedContent` properties, whereas received ones threw away the ciphertext). * Avoids having to make two MatrixEvents in the receive path, and copying fields from one to the other. *Hopefully* most clients have followed the advice given in the jsdoc of not relying on MatrixEvent.event to get at events. If they haven't, I guess they'll break in the face of encrypted events. (The pushprocessor didn't follow this advice, so needed some tweaks.)
Author
Committer
Parents
Loading