Crypto: Support recognising a clearText vs a decrypted to-device event
Draft: Depends on a new wasm-bindings version https://github.com/matrix-org/matrix-rust-sdk-crypto-wasm/pull/226
Notes for reviewer: Since the integration of the rust-sdk it was not possible to make the difference between a succesfully decrypted toDevice event and a clearText toDevice. With the new bindings it is now possible.
This PR integrates this change. The existing MatrixEvent end-points like isEncrypted(), getClearContent(), isDecryptionFailure are now expected to work properly for to-device events.
As for now the SDK is not returning and EncryptionInfo or OlmError, so some of other MatrixEvent will not work fully (getSenderKey(), decryptionFailureReason()).
Not sure what is really needed on all the existing code for MatrixEvent, or what could be removed (like all the deprecated DecryptionFailureCodes, the claimedEd25519Key, etc.., and a lots of things are megolm specific)
Maybe a dedicated MatrixToDevice event?
Checklist
- [ ] Tests written for new code (and old code if feasible).
- [ ] New or updated
public/exportedsymbols have accurate TSDoc documentation. - [ ] Linter and other CI checks pass.
- [ ] Sign-off given on the changes (see CONTRIBUTING.md).
Also: I factored out some of the duplication between the two sync implementations in https://github.com/matrix-org/matrix-js-sdk/pull/4863. It would be good to land that first.
Closed in favor of https://github.com/matrix-org/matrix-js-sdk/pull/4891