pub struct EncryptedEdit<'a> {
pub enc_payload: &'a [u8],
pub enc_iv: &'a [u8],
pub target_message_key: &'a MessageKey,
}Expand description
Extracted edit-envelope fields ready to feed into decrypt.
Fields§
§enc_payload: &'a [u8]§enc_iv: &'a [u8]§target_message_key: &'a MessageKeyImplementations§
Source§impl<'a> EncryptedEdit<'a>
impl<'a> EncryptedEdit<'a>
Sourcepub fn original_sender_jid(&self, my_jid: &Jid) -> Result<Jid, MessageEditError>
pub fn original_sender_jid(&self, my_jid: &Jid) -> Result<Jid, MessageEditError>
Resolve the original sender JID from the target message key alone.
CAUTION: target_message_key is written in the editor’s frame, so its
from_me is true for any edit the editor authored, including an
incoming peer edit, where it then resolves to my_jid (the receiver)
rather than the peer. On the receive path use
Self::original_sender_for_dispatch, which takes the author from the
envelope frame. This target-key-only resolver is kept for callers that
have no envelope frame.
my_jid is the receiver’s own JID in the addressing mode of the chat
(PN or LID). Resolution order:
participantif present (always set in groups).my_jidiffrom_me == Some(true).remote_jidotherwise.
Sourcepub fn original_sender_for_dispatch(
&self,
is_from_me: bool,
envelope_sender: &Jid,
my_jid: &Jid,
) -> Jid
pub fn original_sender_for_dispatch( &self, is_from_me: bool, envelope_sender: &Jid, my_jid: &Jid, ) -> Jid
Resolve the edit’s parent author from the dispatch-time envelope frame.
A message can only be edited by its author, so the parent author of a
MESSAGE_EDIT is always the editor: ourselves for a self-synced edit
(is_from_me), else the envelope sender. Mirrors WA Web’s
MsgGetters.getOriginalSender = originalSelfAuthor || sender and is the
correct resolver for the receive path, where the target key’s from_me
reflects the editor, not the receiver.
Trait Implementations§
Source§impl<'a> Clone for EncryptedEdit<'a>
impl<'a> Clone for EncryptedEdit<'a>
Source§fn clone(&self) -> EncryptedEdit<'a>
fn clone(&self) -> EncryptedEdit<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for EncryptedEdit<'a>
Auto Trait Implementations§
impl<'a> Freeze for EncryptedEdit<'a>
impl<'a> RefUnwindSafe for EncryptedEdit<'a>
impl<'a> Send for EncryptedEdit<'a>
impl<'a> Sync for EncryptedEdit<'a>
impl<'a> Unpin for EncryptedEdit<'a>
impl<'a> UnsafeUnpin for EncryptedEdit<'a>
impl<'a> UnwindSafe for EncryptedEdit<'a>
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more