pub async fn receive_keys_claim_response(&self, response: &KeysClaimResponse) -> OlmResult<()> {
        // TODO log the failures here

        for (user_id, user_devices) in &response.one_time_keys {
            for (device_id, key_map) in user_devices {
                let device = match self.store.get_readonly_device(&user_id, device_id).await {
                    Ok(Some(d)) => d,
                    Ok(None) => {
                        warn!(
                            "Tried to create an Olm session for {} {}, but the device is unknown",
                            user_id, device_id
                        );
                        continue;
                    }
                    Err(e) => {
                        warn!(
                            "Tried to create an Olm session for {} {}, but \
                            can't fetch the device from the store {:?}",
                            user_id, device_id, e
                        );
                        continue;
                    }
                };

                info!("Creating outbound Session for {} {}", user_id, device_id);

                let session = match self.account.create_outbound_session(device, &key_map).await {
                    Ok(s) => s,
                    Err(e) => {
                        warn!("{:?}", e);
                        continue;
                    }
                };

                if let Err(e) = self.store.save_sessions(&[session]).await {
                    error!("Failed to store newly created Olm session {}", e);
                    continue;
                }

                // TODO if this session was created because a previous one was
                // wedged queue up a dummy event to be sent out.
                self.key_request_machine.retry_keyshare(&user_id, device_id);
            }
        }
        Ok(())
    }
/// Receive a successful key claim response and create new Olm sessions with
/// the claimed keys.
///
/// # Arguments
///
/// * `response` - The response containing the claimed one-time keys.
Receive a successful key claim response and create new Olm sessions with
the claimed keys.
Receive a successful key claim response and create new Olm sessions with the claimed keys .
pub async fn receive_keys_claim_response(&self, response: &KeysClaimResponse) -> OlmResult<()> {
        // TODO log the failures here
        for (user_id, user_devices) in &response.one_time_keys {
            for (device_id, key_map) in user_devices {
                let device = match self.store.get_readonly_device(&user_id, device_id).await {
                    Ok(Some(d)) => d,
                    Ok(None) => {
                        warn!(
                            "Tried to create an Olm session for {} {}, but the device is unknown",
                            user_id, device_id
                        );
                        continue;
                    }
                    Err(e) => {
                        warn!(
                            "Tried to create an Olm session for {} {}, but \
                            can't fetch the device from the store {:?}",
                            user_id, device_id, e
                        );
                        continue;
                    }
                };
                info!("Creating outbound Session for {} {}", user_id, device_id);
                let session = match self.account.create_outbound_session(device, &key_map).await {
                    Ok(s) => s,
                    Err(e) => {
                        warn!("{:?}", e);
                        continue;
                    }
                };
                if let Err(e) = self.store.save_sessions(&[session]).await {
                    error!("Failed to store newly created Olm session {}", e);
                    continue;
                }
                // TODO if this session was created because a previous one was
                // wedged queue up a dummy event to be sent out.
                self.key_request_machine.retry_keyshare(&user_id, device_id);
            }
        }
        Ok(())
    }
pub async fn receive_keys_claim_response ( & self , response : & KeysClaimResponse ) -> OlmResult < ( ) > { // TODO log the failures here for ( user_id , user_devices ) in & response . one_time_keys { for ( device_id , key_map ) in user_devices { let device = match self . store . get_readonly_device ( & user_id , device_id ) . await { Ok ( Some ( d ) ) => d , Ok ( None ) => { warn ! ( " " user_id device_id ) ; continue ; } Err ( e ) => { warn ! ( " \
 " user_id device_id e ) ; continue ; } } ; info ! ( " " user_id device_id ) ; let session = match self . account . create_outbound_session ( device , & key_map ) . await { Ok ( s ) => s , Err ( e ) => { warn ! ( " " e ) ; continue ; } } ; if let Err ( e ) = self . store . save_sessions ( & [ session ] ) . await { error ! ( " " e ) ; continue ; } // TODO if this session was created because a previous one was // wedged queue up a dummy event to be sent out. self . key_request_machine . retry_keyshare ( & user_id , device_id ) ; } } Ok ( ( ) ) }
Receive a successful key claim response and create new Olm sessions with
the claimed keys.
Receive a successful key claim response and create new Olm sessions with the claimed keys .
&self
response
&KeysClaimResponse
&self
response
&KeysClaimResponse