check_sender_trust_requirement to use VerificationState (#5044)
There are two reasons for this. Firstly. we've already done a bunch of work to map `SenderData` into a `VerificationState`, and the decision tree from `VerificationState` to allow/reject is simpler than going from `SenderData`, even if we have to fudge it a bit to get the "legacy" flag. (Note that it allows us to get rid of an `unreachable!` panic.) Secondly, `VerficationState` represents the state of an *event*, whereas `SenderData` is about the session as a whole. A session can be fine, whilst events (claiming to be) encrypted with it can be suspect. What we want here is to check a specific message. Currently, this doesn't make any functional difference, but conceptually it's cleaner to check the `VerificationState`. Note that there are a bunch of tests for this method in `matrix-sdk-crypto/src/machine/tests/decryption_verification_state.rs`, called `test_decryption_trust_requirement`.
Matrix Rust SDK
The Matrix Rust SDK is a collection of libraries that make it easier to build Matrix clients in Rust. It takes care of the low-level details like encryption, syncing, and room state, so you can focus on your app's logic and UI. Whether you're writing a small bot, a desktop client, or something in between, the SDK is designed to be flexible, async-friendly, and ready to use out of the box.
Project structure
The Matrix Rust SDK is made up of several crates that build on top of each other. Here are the key ones:
- matrix-sdk-ui – A high-level client library that makes it easy to build full-featured UI clients with minimal setup. Check out our reference client, multiverse, for an example.
- matrix-sdk – A mid-level client library, ideal for building bots, custom clients, or higher-level abstractions. You can find example usage in the examples directory.
- matrix-sdk-crypto – A standalone encryption state machine with no network I/O, providing end-to-end encryption support for Matrix clients and libraries. See the crypto tutorial for a step-by-step introduction.
Status
The library is considered production ready and backs multiple client implementations such as Element X [1] [2], Fractal and iamb. Client developers should feel confident to build upon it.
Development of the SDK has been primarily sponsored by Element though accepts contributions from all.
Bindings
The higher-level crates of the Matrix Rust SDK can be embedded in other environments such as Swift, Kotlin, JavaScript, and Node.js. Check out the bindings/ directory to learn more about how to integrate the SDK into your language of choice.