pub enum UtdCause {
Unknown = 0,
SentBeforeWeJoined = 1,
VerificationViolation = 2,
UnsignedDevice = 3,
UnknownDevice = 4,
HistoricalMessageAndBackupIsDisabled = 5,
WithheldForUnverifiedOrInsecureDevice = 6,
WithheldBySender = 7,
HistoricalMessageAndDeviceIsUnverified = 8,
}
Expand description
Our best guess at the reason why an event can’t be decrypted.
Variants§
Unknown = 0
We don’t have an explanation for why this UTD happened - it is probably a bug, or a network split between the two homeservers.
For example:
-
the keys for this event are missing, but a key storage backup exists and is working, so we should be able to find the keys in the backup.
-
the keys for this event are missing, and a key storage backup exists on the server, but that backup is not working on this client even though this device is verified.
SentBeforeWeJoined = 1
We are missing the keys for this event, and the event was sent when we were not a member of the room (or invited).
VerificationViolation = 2
The message was sent by a user identity we have not verified, but the user was previously verified.
UnsignedDevice = 3
The crate::TrustRequirement
requires that the sending device be
signed by its owner, and it was not.
UnknownDevice = 4
The crate::TrustRequirement
requires that the sending device be
signed by its owner, and we were unable to securely find the device.
This could be because the device has since been deleted, because we haven’t yet downloaded it from the server, or because the session data was obtained from an insecure source (imported from a file, obtained from a legacy (asymmetric) backup, unsafe key forward, etc.)
HistoricalMessageAndBackupIsDisabled = 5
We are missing the keys for this event, but it is a “device-historical” message and there is no key storage backup on the server, presumably because the user has turned it off.
Device-historical means that the message was sent before the current
device existed (but the current user was probably a member of the room
at the time the message was sent). Not to
be confused with pre-join or pre-invite messages (see
UtdCause::SentBeforeWeJoined
for that).
Expected message to user: “History is not available on this device”.
WithheldForUnverifiedOrInsecureDevice = 6
The keys for this event are intentionally withheld.
The sender has refused to share the key because our device does not meet the sender’s security requirements.
WithheldBySender = 7
The keys for this event are missing, likely because the sender was unable to share them (e.g., failure to establish an Olm 1:1 channel). Alternatively, the sender may have deliberately excluded this device by cherry-picking and blocking it, in which case, no action can be taken on our side.
HistoricalMessageAndDeviceIsUnverified = 8
We are missing the keys for this event, but it is a “device-historical” message, and even though a key storage backup does exist, we can’t use it because our device is unverified.
Device-historical means that the message was sent before the current
device existed (but the current user was probably a member of the room
at the time the message was sent). Not to
be confused with pre-join or pre-invite messages (see
UtdCause::SentBeforeWeJoined
for that).
Expected message to user: “You need to verify this device”.
Implementations§
Source§impl UtdCause
impl UtdCause
Sourcepub fn determine(
raw_event: &Raw<AnySyncTimelineEvent>,
crypto_context_info: CryptoContextInfo,
unable_to_decrypt_info: &UnableToDecryptInfo,
) -> Self
pub fn determine( raw_event: &Raw<AnySyncTimelineEvent>, crypto_context_info: CryptoContextInfo, unable_to_decrypt_info: &UnableToDecryptInfo, ) -> Self
Decide the cause of this UTD, based on the evidence we have.
Trait Implementations§
Source§impl<UT> ConvertError<UT> for UtdCause
impl<UT> ConvertError<UT> for UtdCause
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
Source§impl<UT> FfiConverter<UT> for UtdCause
impl<UT> FfiConverter<UT> for UtdCause
Source§const TYPE_ID_META: MetadataBuffer = _
const TYPE_ID_META: MetadataBuffer = _
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
Source§impl<UT> LiftReturn<UT> for UtdCause
impl<UT> LiftReturn<UT> for UtdCause
Source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> LowerError<UT> for UtdCause
impl<UT> LowerError<UT> for UtdCause
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for UtdCause
impl<UT> LowerReturn<UT> for UtdCause
Source§type ReturnType = <UtdCause as Lower<UT>>::FfiType
type ReturnType = <UtdCause as Lower<UT>>::FfiType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustBuffer>
Source§impl<UT> TypeId<UT> for UtdCause
impl<UT> TypeId<UT> for UtdCause
const TYPE_ID_META: MetadataBuffer = _
impl Copy for UtdCause
impl Eq for UtdCause
impl StructuralPartialEq for UtdCause
Auto Trait Implementations§
impl Freeze for UtdCause
impl RefUnwindSafe for UtdCause
impl Send for UtdCause
impl Sync for UtdCause
impl Unpin for UtdCause
impl UnwindSafe for UtdCause
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
Source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more