fn prepare_events(
        &self,
        ciphersuite: &Ciphersuite,
        backend: &impl OpenMlsCryptoProvider,
        proposals: &[ProposalOrRef],
        sender: LeafIndex,
        indexed_members: &HashMap<LeafIndex, Credential>,
    ) -> Vec<GroupEvent> {
        let mut events = Vec::new();
        // We want to collect the events in the order specified by the committer.
        // We convert the pending proposals to a list of references
        let pending_proposals_list = self
            .pending_proposals
            .iter()
            .collect::<Vec<&MlsPlaintext>>();
        // Build a proposal queue for easier searching
        let pending_proposals_queue = ProposalQueue::from_proposals_by_reference(
            ciphersuite,
            backend,
            &pending_proposals_list,
        );
        for proposal_or_ref in proposals {
            match proposal_or_ref {
                ProposalOrRef::Proposal(proposal) => {
                    events.push(self.prepare_proposal_event(proposal, sender, indexed_members));
                }
                ProposalOrRef::Reference(proposal_reference) => {
                    if let Some(queued_proposal) = pending_proposals_queue.get(proposal_reference) {
                        events.push(self.prepare_proposal_event(
                            queued_proposal.proposal(),
                            queued_proposal.sender().to_leaf_index(),
                            indexed_members,
                        ));
                    }
                }
            }
        }
        events
    }
/// Prepare the corresponding events for the proposals covered by the
/// Commit
Prepare the corresponding events for the proposals covered by the
Commit
Prepare the corresponding events for the proposals covered by the Commit
fn prepare_events(
        &self,
        ciphersuite: &Ciphersuite,
        backend: &impl OpenMlsCryptoProvider,
        proposals: &[ProposalOrRef],
        sender: LeafIndex,
        indexed_members: &HashMap<LeafIndex, Credential>,
    ) -> Vec<GroupEvent> {
        let mut events = Vec::new();
        // We want to collect the events in the order specified by the committer.
        // We convert the pending proposals to a list of references
        let pending_proposals_list = self
            .pending_proposals
            .iter()
            .collect::<Vec<&MlsPlaintext>>();
        // Build a proposal queue for easier searching
        let pending_proposals_queue = ProposalQueue::from_proposals_by_reference(
            ciphersuite,
            backend,
            &pending_proposals_list,
        );
        for proposal_or_ref in proposals {
            match proposal_or_ref {
                ProposalOrRef::Proposal(proposal) => {
                    events.push(self.prepare_proposal_event(proposal, sender, indexed_members));
                }
                ProposalOrRef::Reference(proposal_reference) => {
                    if let Some(queued_proposal) = pending_proposals_queue.get(proposal_reference) {
                        events.push(self.prepare_proposal_event(
                            queued_proposal.proposal(),
                            queued_proposal.sender().to_leaf_index(),
                            indexed_members,
                        ));
                    }
                }
            }
        }
        events
    }
fn prepare_events ( & self , ciphersuite : & Ciphersuite , backend : & impl OpenMlsCryptoProvider , proposals : & [ ProposalOrRef ] , sender : LeafIndex , indexed_members : & HashMap < LeafIndex , Credential > , ) -> Vec < GroupEvent > { let mut events = Vec :: new ( ) ; // We want to collect the events in the order specified by the committer. // We convert the pending proposals to a list of references let pending_proposals_list = self . pending_proposals . iter ( ) . collect :: < Vec < & MlsPlaintext > > ( ) ; // Build a proposal queue for easier searching let pending_proposals_queue = ProposalQueue :: from_proposals_by_reference ( ciphersuite , backend , & pending_proposals_list , ) ; for proposal_or_ref in proposals { match proposal_or_ref { ProposalOrRef :: Proposal ( proposal ) => { events . push ( self . prepare_proposal_event ( proposal , sender , indexed_members ) ) ; } ProposalOrRef :: Reference ( proposal_reference ) => { if let Some ( queued_proposal ) = pending_proposals_queue . get ( proposal_reference ) { events . push ( self . prepare_proposal_event ( queued_proposal . proposal ( ) , queued_proposal . sender ( ) . to_leaf_index ( ) , indexed_members , ) ) ; } } } } events }
Prepare the corresponding events for the proposals covered by the
Commit
Prepare the corresponding events for the proposals covered by the Commit
&self
ciphersuite
&Ciphersuite
backend
&impl OpenMlsCryptoProvider
proposals
&[ProposalOrRef]
sender
LeafIndex
indexed_members
&HashMap<LeafIndex, Credential>
&self
ciphersuite
&Ciphersuite
backend
&impl OpenMlsCryptoProvider
proposals
&[ProposalOrRef]
sender
LeafIndex
indexed_members
&HashMap<LeafIndex, Credential>