From b5f2128db17129cab978fd8b121a4ee89fb635cb Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 12 Dec 2025 15:01:17 +0000 Subject: [PATCH] common: remove now-unused `ShieldStateCode::SentInClear` --- crates/matrix-sdk-common/CHANGELOG.md | 7 +++++++ crates/matrix-sdk-common/src/deserialized_responses.rs | 3 --- .../src/snapshots/snapshot_test_shield_codes-5.snap | 4 ++-- crates/matrix-sdk-ui/src/timeline/event_item/mod.rs | 1 - 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/matrix-sdk-common/CHANGELOG.md b/crates/matrix-sdk-common/CHANGELOG.md index 1a9cb7d7d..80e352021 100644 --- a/crates/matrix-sdk-common/CHANGELOG.md +++ b/crates/matrix-sdk-common/CHANGELOG.md @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - ReleaseDate +### Features + +- [**breaking**] `ShieldStateCode` no longer includes + `SentInClear`. `VeificationState::to_shield_state_{lax,strict}` never + returned that code, ans so having it in the enum was somewhat misleading. + ([#5959](https://github.com/matrix-org/matrix-rust-sdk/pull/5959)) + ### Bug Fixes - Fix `TimelineEvent::from_bundled_latest_event` sometimes removing the `session_id` of UTDs. This broken event could later be saved to the event cache and become an unresolvable UTD. ([#5970](https://github.com/matrix-org/matrix-rust-sdk/pull/5970)). diff --git a/crates/matrix-sdk-common/src/deserialized_responses.rs b/crates/matrix-sdk-common/src/deserialized_responses.rs index 93d8a6153..1d1daa031 100644 --- a/crates/matrix-sdk-common/src/deserialized_responses.rs +++ b/crates/matrix-sdk-common/src/deserialized_responses.rs @@ -282,8 +282,6 @@ pub enum ShieldStateCode { UnsignedDevice, /// The sender hasn't been verified by the Client's user. UnverifiedIdentity, - /// An unencrypted event in an encrypted room. - SentInClear, /// The sender was previously verified but changed their identity. #[serde(alias = "PreviouslyVerified")] VerificationViolation, @@ -1983,7 +1981,6 @@ mod tests { assert_json_snapshot!(ShieldStateCode::UnknownDevice); assert_json_snapshot!(ShieldStateCode::UnsignedDevice); assert_json_snapshot!(ShieldStateCode::UnverifiedIdentity); - assert_json_snapshot!(ShieldStateCode::SentInClear); assert_json_snapshot!(ShieldStateCode::VerificationViolation); }); } diff --git a/crates/matrix-sdk-common/src/snapshots/snapshot_test_shield_codes-5.snap b/crates/matrix-sdk-common/src/snapshots/snapshot_test_shield_codes-5.snap index 7b294abf0..753b4b444 100644 --- a/crates/matrix-sdk-common/src/snapshots/snapshot_test_shield_codes-5.snap +++ b/crates/matrix-sdk-common/src/snapshots/snapshot_test_shield_codes-5.snap @@ -1,5 +1,5 @@ --- source: crates/matrix-sdk-common/src/deserialized_responses.rs -expression: "ShieldStateCode::SentInClear" +expression: "ShieldStateCode::VerificationViolation" --- -"SentInClear" +"VerificationViolation" diff --git a/crates/matrix-sdk-ui/src/timeline/event_item/mod.rs b/crates/matrix-sdk-ui/src/timeline/event_item/mod.rs index a14c53a84..09f48b9d6 100644 --- a/crates/matrix-sdk-ui/src/timeline/event_item/mod.rs +++ b/crates/matrix-sdk-ui/src/timeline/event_item/mod.rs @@ -755,7 +755,6 @@ impl From for TimelineEventShieldStateCode { ShieldStateCode::UnknownDevice => UnknownDevice, ShieldStateCode::UnsignedDevice => UnsignedDevice, ShieldStateCode::UnverifiedIdentity => UnverifiedIdentity, - ShieldStateCode::SentInClear => SentInClear, ShieldStateCode::VerificationViolation => VerificationViolation, ShieldStateCode::MismatchedSender => MismatchedSender, }