diff --git a/crates/matrix-sdk-crypto/src/machine/mod.rs b/crates/matrix-sdk-crypto/src/machine/mod.rs index eb334ab7438..3624f4aa2cb 100644 --- a/crates/matrix-sdk-crypto/src/machine/mod.rs +++ b/crates/matrix-sdk-crypto/src/machine/mod.rs @@ -2564,6 +2564,13 @@ pub struct EncryptionSyncChanges<'a> { pub next_batch_token: Option, } +/// Convert a [`MegolmError`] into an [`UnableToDecryptInfo`] or a +/// [`CryptoStoreError`]. +/// +/// Most `MegolmError` codes are converted into a suitable +/// `UnableToDecryptInfo`. The exception is [`MegolmError::Store`], which +/// represents a problem with our datastore rather than with the message itself, +/// and is therefore returned as a `CryptoStoreError`. fn megolm_error_to_utd_info( raw_event: &Raw, error: MegolmError,