mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-04 05:58:11 -04:00
This patch introduces the new `EncryptionState` to represent the 3 possible states: `Encrypted`, `NotEncrypted` or `Unknown`. All the `is_encrypted` methods have been replaced by `encryption_state`. The most noticable change is in `matrix_sdk::Room` where `async fn is_encrypted(&self) -> Result<bool>` has been replaced by `fn fn encryption_state(&self) -> EncryptionState`. However, a new `async fn latest_encryption_state(&self) -> Result<EncryptionState>` method “restores” the previous behaviour by calling `request_encryption_state` if necessary. The idea is that the caller is now responsible to call `request_encryption_state` if desired, or use `latest_encryption_state` to automate the call if necessary. `encryption_state` is now non-async and infallible everywhere. `matrix-sdk-ffi` has been updated but no methods have been added for the moment.