pub fn distribute_to_members(
        &self,
        // We need the sender to know a group member that we know can not have
        // been removed from the group.
        sender_id: &[u8],
        group: &mut Group,
        message: &MlsMessageOut,
    ) -> Result<(), ClientError> {
        // Test serialization if mandated by config
        let message = match self.use_codec {
            CodecUse::SerializedMessages => {
                let serialized_message =
                    MlsMessageIn::from(message.clone()).tls_serialize_detached()?;
                MlsMessageIn::tls_deserialize(&mut serialized_message.as_slice())?
            }
            CodecUse::StructMessages => MlsMessageIn::from(message.clone()),
        };
        let clients = self.clients.borrow();
        // Distribute message to all members.
        for (_index, member_id) in &group.members {
            let member = clients.get(member_id).unwrap().borrow();
            member.receive_messages_for_group(&message)?;
        }
        // Get the current tree and figure out who's still in the group.
        let sender = clients.get(sender_id).unwrap().borrow();
        let sender_groups = sender.groups.borrow();
        let sender_group = sender_groups.get(&group.group_id).unwrap();
        group.members = sender
            .get_members_of_group(&group.group_id)?
            .iter()
            .map(|(index, cred)| (*index, cred.identity().to_vec()))
            .collect();
        group.public_tree = sender_group.export_ratchet_tree();
        group.exporter_secret = sender_group.export_secret(&sender.crypto, "test", &[], 32)?;
        Ok(())
    }
/// Distribute a set of messages sent by the sender with identity
/// `sender_id` to their intended recipients in group `Group`. This function
/// also verifies that all members of that group agree on the public tree.
Distribute a set of messages sent by the sender with identity
`sender_id` to their intended recipients in group `Group`. This function
also verifies that all members of that group agree on the public tree.
Distribute a set of messages sent by the sender with identity ` sender_id ` to their intended recipients in group ` Group ` . This function also verifies that all members of that group agree on the public tree .
pub fn distribute_to_members(
        &self,
        // We need the sender to know a group member that we know can not have
        // been removed from the group.
        sender_id: &[u8],
        group: &mut Group,
        message: &MlsMessageOut,
    ) -> Result<(), ClientError> {
        // Test serialization if mandated by config
        let message = match self.use_codec {
            CodecUse::SerializedMessages => {
                let serialized_message =
                    MlsMessageIn::from(message.clone()).tls_serialize_detached()?;
                MlsMessageIn::tls_deserialize(&mut serialized_message.as_slice())?
            }
            CodecUse::StructMessages => MlsMessageIn::from(message.clone()),
        };
        let clients = self.clients.borrow();
        // Distribute message to all members.
        for (_index, member_id) in &group.members {
            let member = clients.get(member_id).unwrap().borrow();
            member.receive_messages_for_group(&message)?;
        }
        // Get the current tree and figure out who's still in the group.
        let sender = clients.get(sender_id).unwrap().borrow();
        let sender_groups = sender.groups.borrow();
        let sender_group = sender_groups.get(&group.group_id).unwrap();
        group.members = sender
            .get_members_of_group(&group.group_id)?
            .iter()
            .map(|(index, cred)| (*index, cred.identity().to_vec()))
            .collect();
        group.public_tree = sender_group.export_ratchet_tree();
        group.exporter_secret = sender_group.export_secret(&sender.crypto, "test", &[], 32)?;
        Ok(())
    }
pub fn distribute_to_members ( & self , // We need the sender to know a group member that we know can not have // been removed from the group. sender_id : & [ u8 ] , group : & mut Group , message : & MlsMessageOut , ) -> Result < ( ) , ClientError > { // Test serialization if mandated by config let message = match self . use_codec { CodecUse :: SerializedMessages => { let serialized_message = MlsMessageIn :: from ( message . clone ( ) ) . tls_serialize_detached ( ) ? ; MlsMessageIn :: tls_deserialize ( & mut serialized_message . as_slice ( ) ) ? } CodecUse :: StructMessages => MlsMessageIn :: from ( message . clone ( ) ) , } ; let clients = self . clients . borrow ( ) ; // Distribute message to all members. for ( _index , member_id ) in & group . members { let member = clients . get ( member_id ) . unwrap ( ) . borrow ( ) ; member . receive_messages_for_group ( & message ) ? ; } // Get the current tree and figure out who's still in the group. let sender = clients . get ( sender_id ) . unwrap ( ) . borrow ( ) ; let sender_groups = sender . groups . borrow ( ) ; let sender_group = sender_groups . get ( & group . group_id ) . unwrap ( ) ; group . members = sender . get_members_of_group ( & group . group_id ) ? . iter ( ) . map ( | ( index , cred ) | ( * index , cred . identity ( ) . to_vec ( ) ) ) . collect ( ) ; group . public_tree = sender_group . export_ratchet_tree ( ) ; group . exporter_secret = sender_group . export_secret ( & sender . crypto , " " , & [ ] , 32 ) ? ; Ok ( ( ) ) }
Distribute a set of messages sent by the sender with identity
`sender_id` to their intended recipients in group `Group`.
Distribute a set of messages sent by the sender with identity ` sender_id ` to their intended recipients in group ` Group ` .
&self
sender_id
&[u8]
group
&mut Group
message
&MlsMessageOut
&self
sender_id
&[u8]
group
&mut Group
message
&MlsMessageOut