pub fn add_members(
        &self,
        action_type: ActionType,
        group_id: &GroupId,
        key_packages: &[KeyPackage],
    ) -> Result<(Vec<MlsMessageOut>, Option<Welcome>), ClientError> {
        let mut groups = self.groups.borrow_mut();
        let group = groups
            .get_mut(group_id)
            .ok_or(ClientError::NoMatchingGroup)?;
        let action_results = match action_type {
            ActionType::Commit => {
                let (messages, welcome) = group.add_members(&self.crypto, key_packages)?;
                (vec![messages], Some(welcome))
            }
            ActionType::Proposal => {
                let mut messages = Vec::new();
                for key_package in key_packages {
                    let message = group.propose_add_member(&self.crypto, key_package)?;
                    messages.push(message);
                }
                (messages, None)
            }
        };
        Ok(action_results)
    }
/// Have the client either propose or commit (depending on the
/// `action_type`) adding the clients with the given `KeyPackage`s to the
/// group with the given group id. Returns an error if no group with the
/// given group id can be found or if an error occurs while performing the
/// add operation.
Have the client either propose or commit (depending on the
`action_type`) adding the clients with the given `KeyPackage`s to the
group with the given group id. Returns an error if no group with the
given group id can be found or if an error occurs while performing the
add operation.
Have the client either propose or commit ( depending on the ` action_type ` ) adding the clients with the given ` KeyPackage ` s to the group with the given group id . Returns an error if no group with the given group id can be found or if an error occurs while performing the add operation .
pub fn add_members(
        &self,
        action_type: ActionType,
        group_id: &GroupId,
        key_packages: &[KeyPackage],
    ) -> Result<(Vec<MlsMessageOut>, Option<Welcome>), ClientError> {
        let mut groups = self.groups.borrow_mut();
        let group = groups
            .get_mut(group_id)
            .ok_or(ClientError::NoMatchingGroup)?;
        let action_results = match action_type {
            ActionType::Commit => {
                let (messages, welcome) = group.add_members(&self.crypto, key_packages)?;
                (vec![messages], Some(welcome))
            }
            ActionType::Proposal => {
                let mut messages = Vec::new();
                for key_package in key_packages {
                    let message = group.propose_add_member(&self.crypto, key_package)?;
                    messages.push(message);
                }
                (messages, None)
            }
        };
        Ok(action_results)
    }
pub fn add_members ( & self , action_type : ActionType , group_id : & GroupId , key_packages : & [ KeyPackage ] , ) -> Result < ( Vec < MlsMessageOut > , Option < Welcome > ) , ClientError > { let mut groups = self . groups . borrow_mut ( ) ; let group = groups . get_mut ( group_id ) . ok_or ( ClientError :: NoMatchingGroup ) ? ; let action_results = match action_type { ActionType :: Commit => { let ( messages , welcome ) = group . add_members ( & self . crypto , key_packages ) ? ; ( vec ! [ messages ] , Some ( welcome ) ) } ActionType :: Proposal => { let mut messages = Vec :: new ( ) ; for key_package in key_packages { let message = group . propose_add_member ( & self . crypto , key_package ) ? ; messages . push ( message ) ; } ( messages , None ) } } ; Ok ( action_results ) }
Have the client either propose or commit (depending on the
`action_type`) adding the clients with the given `KeyPackage`s to the
group with the given group id.
Have the client either propose or commit ( depending on the ` action_type ` ) adding the clients with the given ` KeyPackage ` s to the group with the given group id .
&self
action_type
ActionType
group_id
&GroupId
key_packages
&[KeyPackage]
&self
action_type
ActionType
group_id
&GroupId
key_packages
&[KeyPackage]