Skip to content

Commit

Permalink
review: better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Nov 27, 2024
1 parent 38f1b60 commit 8990e07
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crates/matrix-sdk-crypto/src/types/events/utd_cause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ pub enum UtdCause {
/// obtained from a legacy (asymmetric) backup, unsafe key forward, etc.)
UnknownDevice = 4,

/// We are missing the keys for this event, but it is an historical message
/// and no backup is accessible or usable.
/// We are missing the keys for this event, but it is a "device historical"
/// message and no backup is accessible or usable.
/// Device historical means that the message was sent before the current
/// device existed, but the current user is a member of the room. Not to
/// be confounded to pre-join or pre-invite messages (see
/// `SentBeforeWeJoined` for that).
HistoricalMessage = 5,
}

Expand All @@ -69,17 +73,17 @@ enum Membership {
Join,
}

/// Contextual crypto information used to properly [`UtdCause::determine`] an
/// Unable-To-Decrypt cause in addition to the [`UnableToDecryptInfo`] and raw
/// event info.
/// Contextual crypto information used by [`UtdCause::determine`] to properly
/// identify an Unable-To-Decrypt cause in addition to the
/// [`UnableToDecryptInfo`] and raw event info.
#[derive(Debug, Clone, Copy)]
pub struct CryptoContextInfo {
/// The current device creation timestamp, used as a heuristic to determine
/// if an event is device historical or not (sent before the current device
/// existed)
pub device_creation_ts: MilliSecondsSinceUnixEpoch,
/// True if key storage is correctly set up and can be used by the current
/// client.
/// client to download and decrypt message keys.
pub is_backup_configured: bool,
}

Expand Down

0 comments on commit 8990e07

Please sign in to comment.