Skip to content

Commit

Permalink
review: expand WithheldCode wildcard match arms
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Dec 3, 2024
1 parent 9270a2b commit 0eee845
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion crates/matrix-sdk-common/src/deserialized_responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,6 @@ impl UnableToDecryptReason {
SerializeAsRefStr,
DeserializeFromCowStr,
)]
#[non_exhaustive]
pub enum WithheldCode {
/// the user/device was blacklisted.
#[ruma_enum(rename = "m.blacklisted")]
Expand Down
6 changes: 5 additions & 1 deletion crates/matrix-sdk-crypto/src/types/events/utd_cause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ impl UtdCause {
UnableToDecryptReason::MissingMegolmSession { withheld_code: Some(reason) } => {
match reason {
WithheldCode::Unverified => UtdCause::WithheldForUnverifiedOrInsecureDevice,
_ => UtdCause::WithheldBySender,
WithheldCode::Blacklisted
| WithheldCode::Unauthorised
| WithheldCode::Unavailable
| WithheldCode::NoOlm
| WithheldCode::_Custom(_) => UtdCause::WithheldBySender,
}
}
UnableToDecryptReason::MissingMegolmSession { withheld_code: None }
Expand Down

0 comments on commit 0eee845

Please sign in to comment.