Skip to content

Commit

Permalink
MessageOut API fix (openmls#1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelrobert authored May 23, 2023
1 parent a591182 commit 5060487
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion openmls/src/framing/message_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ impl From<PublicMessage> for MlsMessageOut {
}
}

impl From<PrivateMessage> for MlsMessageOut {
fn from(private_message: PrivateMessage) -> Self {
Self {
// TODO #34: The version should be set explicitly here instead of
// the default.
version: ProtocolVersion::default(),
body: MlsMessageOutBody::PrivateMessage(private_message),
}
}
}

impl From<GroupInfo> for MlsMessageOut {
fn from(group_info: GroupInfo) -> Self {
Self {
Expand Down Expand Up @@ -120,7 +131,7 @@ impl MlsMessageOut {

/// Create an [`MlsMessageOut`] from a [`Welcome`] message and the currently
/// used [`ProtocolVersion`].
pub(crate) fn from_welcome(welcome: Welcome, version: ProtocolVersion) -> Self {
pub fn from_welcome(welcome: Welcome, version: ProtocolVersion) -> Self {
MlsMessageOut {
version,
body: MlsMessageOutBody::Welcome(welcome),
Expand Down

0 comments on commit 5060487

Please sign in to comment.