pub enum SenderData {
UnknownDevice {
legacy_session: bool,
owner_check_failed: bool,
},
DeviceInfo {
device_keys: DeviceKeys,
legacy_session: bool,
},
VerificationViolation(KnownSenderData),
SenderUnverified(KnownSenderData),
SenderVerified(KnownSenderData),
}
Expand description
Information on the device and user that sent the megolm session data to us
Sessions start off in UnknownDevice
state, and progress into DeviceInfo
state when we get the device info. Finally, if we can look up the sender
using the device info, the session can be moved into
VerificationViolation
, SenderUnverified
, or
SenderVerified
state, depending on the verification status of the user.
If the user’s verification state changes, the state may change accordingly.
Variants§
UnknownDevice
We have not yet found the (signed) device info for the sending device, or we did find a device but it does not own the session.
Fields
DeviceInfo
We have the signed device info for the sending device, but not yet the cross-signing key that it was signed with.
Fields
device_keys: DeviceKeys
Information about the device that sent the to-device message creating this session.
VerificationViolation(KnownSenderData)
We have found proof that this user, with this cross-signing key, sent the to-device message that established this session, but we have not yet verified the cross-signing key, and we had verified a previous cross-signing key for this user.
SenderUnverified(KnownSenderData)
We have found proof that this user, with this cross-signing key, sent the to-device message that established this session, but we have not yet verified the cross-signing key.
SenderVerified(KnownSenderData)
We have found proof that this user, with this cross-signing key, sent the to-device message that established this session, and we have verified the cross-signing key.
Implementations§
Source§impl SenderData
impl SenderData
Sourcepub fn unknown() -> Self
pub fn unknown() -> Self
Create a SenderData
which contains no device info.
Sourcepub fn device_info(device_keys: DeviceKeys) -> Self
pub fn device_info(device_keys: DeviceKeys) -> Self
Create a SenderData
which contains device info.
Sourcepub fn sender_verification_violation(
user_id: &UserId,
device_id: &DeviceId,
master_key: Ed25519PublicKey,
) -> Self
pub fn sender_verification_violation( user_id: &UserId, device_id: &DeviceId, master_key: Ed25519PublicKey, ) -> Self
Create a SenderData
with a known but unverified sender, where the
sender was previously verified.
Sourcepub fn sender_unverified(
user_id: &UserId,
device_id: &DeviceId,
master_key: Ed25519PublicKey,
) -> Self
pub fn sender_unverified( user_id: &UserId, device_id: &DeviceId, master_key: Ed25519PublicKey, ) -> Self
Create a SenderData
with a known but unverified sender.
Sourcepub fn sender_verified(
user_id: &UserId,
device_id: &DeviceId,
master_key: Ed25519PublicKey,
) -> Self
pub fn sender_verified( user_id: &UserId, device_id: &DeviceId, master_key: Ed25519PublicKey, ) -> Self
Create a SenderData
with a verified sender.
Sourcepub fn legacy() -> Self
pub fn legacy() -> Self
Create a SenderData
which has the legacy flag set. Caution: messages
within sessions with this flag will be displayed in some contexts,
even when we are unable to verify the sender.
The returned struct contains no device info.
Sourcepub fn to_type(&self) -> SenderDataType
pub fn to_type(&self) -> SenderDataType
Return our type as a SenderDataType
.
Trait Implementations§
Source§impl Clone for SenderData
impl Clone for SenderData
Source§fn clone(&self) -> SenderData
fn clone(&self) -> SenderData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SenderData
impl Debug for SenderData
Source§impl Default for SenderData
Used when deserialising and the sender_data property is missing.
If we are deserialising an InboundGroupSession session with missing
sender_data, this must be a legacy session (i.e. it was created before we
started tracking sender data). We set its legacy flag to true, so we can
populate it with trust information if it is available later.
impl Default for SenderData
Used when deserialising and the sender_data property is missing. If we are deserialising an InboundGroupSession session with missing sender_data, this must be a legacy session (i.e. it was created before we started tracking sender data). We set its legacy flag to true, so we can populate it with trust information if it is available later.
Source§impl<'de> Deserialize<'de> for SenderData
impl<'de> Deserialize<'de> for SenderData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SenderData
impl PartialEq for SenderData
Source§impl Serialize for SenderData
impl Serialize for SenderData
impl StructuralPartialEq for SenderData
Auto Trait Implementations§
impl Freeze for SenderData
impl RefUnwindSafe for SenderData
impl Send for SenderData
impl Sync for SenderData
impl Unpin for SenderData
impl UnwindSafe for SenderData
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,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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