use super::{AttachmentBuilder, Message, MessageType};
impl Message {
pub fn as_out_of_band_invitation(
mut self,
body: impl AsRef<[u8]>,
attachments: Option<Vec<AttachmentBuilder>>,
) -> Self {
self.jwm_header.typ = MessageType::DidCommRaw;
self.didcomm_header.m_type =
serde_json::to_string(&MessageType::DidCommInvitation).unwrap();
if let Some(attachments) = attachments {
for attachment in attachments {
self.apeend_attachment(attachment);
}
}
self.body(std::str::from_utf8(body.as_ref()).unwrap())
}
}