pub fn send_msg(&self, msg: &str, group: String) -> Result<(), String> {
        let groups = self.groups.borrow();
        let group = match groups.get(group.as_bytes()) {
            Some(g) => g,
            None => return Err("Unknown group".to_string()),
        };

        let mls_ciphertext = match group.mls_group.borrow_mut().create_application_message(
            &group.group_aad,
            msg.as_bytes(),
            &self.identity.borrow().credential,
            PADDING_SIZE,
            &self.crypto,
        ) {
            Ok(m) => m,
            Err(e) => return Err(format!("{}", e)),
        };

        // Send mls_ciphertext to the group
        let msg = GroupMessage::new(
            DsMlsMessage::Ciphertext(mls_ciphertext),
            &self.recipients(group),
        );
        log::debug!(" >>> send: {:?}", msg);
        let _response = self.backend.send_msg(&msg)?;
        Ok(())
    }
/// Send an application message to the group.
Send an application message to the group.
Send an application message to the group .
pub fn send_msg(&self, msg: &str, group: String) -> Result<(), String> {
        let groups = self.groups.borrow();
        let group = match groups.get(group.as_bytes()) {
            Some(g) => g,
            None => return Err("Unknown group".to_string()),
        };
        let mls_ciphertext = match group.mls_group.borrow_mut().create_application_message(
            &group.group_aad,
            msg.as_bytes(),
            &self.identity.borrow().credential,
            PADDING_SIZE,
            &self.crypto,
        ) {
            Ok(m) => m,
            Err(e) => return Err(format!("{}", e)),
        };
        // Send mls_ciphertext to the group
        let msg = GroupMessage::new(
            DsMlsMessage::Ciphertext(mls_ciphertext),
            &self.recipients(group),
        );
        log::debug!(" >>> send: {:?}", msg);
        let _response = self.backend.send_msg(&msg)?;
        Ok(())
    }
pub fn send_msg ( & self , msg : & str , group : String ) -> Result < ( ) , String > { let groups = self . groups . borrow ( ) ; let group = match groups . get ( group . as_bytes ( ) ) { Some ( g ) => g , None => return Err ( " " . to_string ( ) ) , } ; let mls_ciphertext = match group . mls_group . borrow_mut ( ) . create_application_message ( & group . group_aad , msg . as_bytes ( ) , & self . identity . borrow ( ) . credential , PADDING_SIZE , & self . crypto , ) { Ok ( m ) => m , Err ( e ) => return Err ( format ! ( " " e ) ) , } ; // Send mls_ciphertext to the group let msg = GroupMessage :: new ( DsMlsMessage :: Ciphertext ( mls_ciphertext ) , & self . recipients ( group ) , ) ; log :: debug ! ( " " msg ) ; let _response = self . backend . send_msg ( & msg ) ? ; Ok ( ( ) ) }
Send an application message to the group.
Send an application message to the group .
&self
msg
&str
group
String
&self
msg
&str
group
String