Crypto: Support recognising a clearText vs a decrypted to-device event #4835
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Draft: Depends on a new wasm-bindings version matrix-org/matrix-rust-sdk-crypto-wasm#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 likeisEncrypted()
,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
public
/exported
symbols have accurate TSDoc documentation.