async fn save_session(
        &self,
        key_info: OugoingKeyInfo,
        session: InboundGroupSession,
    ) -> Result<(), CryptoStoreError> {
        // TODO perhaps only remove the key info if the first known index is 0.
        trace!(
            "Successfully received a forwarded room key for {:#?}",
            key_info
        );

        self.store.save_inbound_group_sessions(&[session]).await?;
        self.outgoing_to_device_requests
            .remove(&key_info.request_id);
        self.delete_key_info(&key_info).await?;

        let content = RoomKeyRequestEventContent {
            action: Action::CancelRequest,
            request_id: key_info.request_id.to_string(),
            requesting_device_id: (&*self.device_id).clone(),
            body: None,
        };

        let id = Uuid::new_v4();

        let request = wrap_key_request_content(self.user_id().clone(), id, &content)?;

        self.outgoing_to_device_requests.insert(id, request);

        Ok(())
    }
/// Save an inbound group session we received using a key forward.
///
/// At the same time delete the key info since we received the wanted key.
Save an inbound group session we received using a key forward.
At the same time delete the key info since we received the wanted key.
Save an inbound group session we received using a key forward . At the same time delete the key info since we received the wanted key .
async fn save_session(
        &self,
        key_info: OugoingKeyInfo,
        session: InboundGroupSession,
    ) -> Result<(), CryptoStoreError> {
        // TODO perhaps only remove the key info if the first known index is 0.
        trace!(
            "Successfully received a forwarded room key for {:#?}",
            key_info
        );
        self.store.save_inbound_group_sessions(&[session]).await?;
        self.outgoing_to_device_requests
            .remove(&key_info.request_id);
        self.delete_key_info(&key_info).await?;
        let content = RoomKeyRequestEventContent {
            action: Action::CancelRequest,
            request_id: key_info.request_id.to_string(),
            requesting_device_id: (&*self.device_id).clone(),
            body: None,
        };
        let id = Uuid::new_v4();
        let request = wrap_key_request_content(self.user_id().clone(), id, &content)?;
        self.outgoing_to_device_requests.insert(id, request);
        Ok(())
    }
async fn save_session ( & self , key_info : OugoingKeyInfo , session : InboundGroupSession , ) -> Result < ( ) , CryptoStoreError > { // TODO perhaps only remove the key info if the first known index is 0. trace ! ( " " key_info ) ; self . store . save_inbound_group_sessions ( & [ session ] ) . await ? ; self . outgoing_to_device_requests . remove ( & key_info . request_id ) ; self . delete_key_info ( & key_info ) . await ? ; let content = RoomKeyRequestEventContent { action : Action :: CancelRequest , request_id : key_info . request_id . to_string ( ) , requesting_device_id : ( & * self . device_id ) . clone ( ) , body : None , } ; let id = Uuid :: new_v4 ( ) ; let request = wrap_key_request_content ( self . user_id ( ) . clone ( ) , id , & content ) ? ; self . outgoing_to_device_requests . insert ( id , request ) ; Ok ( ( ) ) }
Save an inbound group session we received using a key forward.
Save an inbound group session we received using a key forward .
&self
key_info
OugoingKeyInfo
session
InboundGroupSession
&self
key_info
OugoingKeyInfo
session
InboundGroupSession