pub(crate) async fn create_outbound_session_helper(
        &self,
        their_identity_key: &str,
        their_one_time_key: &SignedKey,
    ) -> Result<Session, OlmSessionError> {
        let session = self
            .inner
            .lock()
            .await
            .create_outbound_session(their_identity_key, &their_one_time_key.key)?;

        let now = Instant::now();
        let session_id = session.session_id();

        Ok(Session {
            user_id: self.user_id.clone(),
            device_id: self.device_id.clone(),
            our_identity_keys: self.identity_keys.clone(),
            inner: Arc::new(Mutex::new(session)),
            session_id: session_id.into(),
            sender_key: their_identity_key.into(),
            created_using_fallback_key: their_one_time_key.fallback,
            creation_time: Arc::new(now),
            last_use_time: Arc::new(now),
        })
    }
/// Create a new session with another account given a one-time key.
///
/// Returns the newly created session or a `OlmSessionError` if creating a
/// session failed.
///
/// # Arguments
/// * `their_identity_key` - The other account's identity/curve25519 key.
///
/// * `their_one_time_key` - A signed one-time key that the other account
/// created and shared with us.
Create a new session with another account given a one-time key.
Returns the newly created session or a `OlmSessionError` if creating a
session failed.
Create a new session with another account given a one - time key . Returns the newly created session or a ` OlmSessionError ` if creating a session failed .
pub(crate) async fn create_outbound_session_helper(
        &self,
        their_identity_key: &str,
        their_one_time_key: &SignedKey,
    ) -> Result<Session, OlmSessionError> {
        let session = self
            .inner
            .lock()
            .await
            .create_outbound_session(their_identity_key, &their_one_time_key.key)?;
        let now = Instant::now();
        let session_id = session.session_id();
        Ok(Session {
            user_id: self.user_id.clone(),
            device_id: self.device_id.clone(),
            our_identity_keys: self.identity_keys.clone(),
            inner: Arc::new(Mutex::new(session)),
            session_id: session_id.into(),
            sender_key: their_identity_key.into(),
            created_using_fallback_key: their_one_time_key.fallback,
            creation_time: Arc::new(now),
            last_use_time: Arc::new(now),
        })
    }
pub ( crate ) async fn create_outbound_session_helper ( & self , their_identity_key : & str , their_one_time_key : & SignedKey , ) -> Result < Session , OlmSessionError > { let session = self . inner . lock ( ) . await . create_outbound_session ( their_identity_key , & their_one_time_key . key ) ? ; let now = Instant :: now ( ) ; let session_id = session . session_id ( ) ; Ok ( Session { user_id : self . user_id . clone ( ) , device_id : self . device_id . clone ( ) , our_identity_keys : self . identity_keys . clone ( ) , inner : Arc :: new ( Mutex :: new ( session ) ) , session_id : session_id . into ( ) , sender_key : their_identity_key . into ( ) , created_using_fallback_key : their_one_time_key . fallback , creation_time : Arc :: new ( now ) , last_use_time : Arc :: new ( now ) , } ) }
Create a new session with another account given a one-time key.
Create a new session with another account given a one - time key .
&self
their_identity_key
&str
their_one_time_key
&SignedKey
&self
their_identity_key
&str
their_one_time_key
&SignedKey