Skip to content

Commit

Permalink
[uniffi] Rename enum variants to avoid collision (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeisler authored Mar 6, 2024
1 parent 2f7d6d2 commit 7b1a4d0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mls-rs-uniffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ pub enum ReceivedMessage {
/// A new commit was processed creating a new group state.
Commit { committer: Arc<SigningIdentity> },

// TODO(mgeisler): rename to `Proposal` when
// https://github.com/awslabs/mls-rs/issues/98 is fixed.
/// A proposal was received.
Proposal {
ReceivedProposal {
sender: Arc<SigningIdentity>,
proposal: Arc<Proposal>,
},
Expand All @@ -249,8 +251,10 @@ pub enum ReceivedMessage {
/// Validated welcome message.
Welcome,

// TODO(mgeisler): rename to `KeyPackage` when
// https://github.com/awslabs/mls-rs/issues/98 is fixed.
/// Validated key package.
KeyPackage { key_package: Arc<KeyPackage> },
ValidatedKeyPackage { key_package: Arc<KeyPackage> },
}

/// Supported cipher suites.
Expand Down Expand Up @@ -655,7 +659,7 @@ impl Group {
_ => todo!("External and NewMember proposal senders are not supported"),
};
let proposal = Arc::new(proposal_message.proposal.into());
Ok(ReceivedMessage::Proposal { sender, proposal })
Ok(ReceivedMessage::ReceivedProposal { sender, proposal })
}
// TODO: group::ReceivedMessage::GroupInfo does not have any
// public methods (unless the "ffi" Cargo feature is set).
Expand All @@ -664,7 +668,7 @@ impl Group {
group::ReceivedMessage::Welcome => Ok(ReceivedMessage::Welcome),
group::ReceivedMessage::KeyPackage(key_package) => {
let key_package = Arc::new(key_package.into());
Ok(ReceivedMessage::KeyPackage { key_package })
Ok(ReceivedMessage::ValidatedKeyPackage { key_package })
}
}
}
Expand Down

0 comments on commit 7b1a4d0

Please sign in to comment.