Skip to content

Commit

Permalink
get it compiling correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Apr 6, 2024
1 parent 49531ba commit 0a0a5b2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use xmtp_mls::{
client::Client as MlsClient,
groups::MlsGroup,
storage::{
group_message::StoredGroupMessage, EncryptedMessageStore, EncryptionKey, StorageOption,
group_message::StoredGroupMessage, EncryptedMessageStore, EncryptionKey, StorageOption, group_message::GroupMessageKind,
},
types::Address,
};
Expand Down Expand Up @@ -485,16 +485,16 @@ impl FfiGroup {
}

#[derive(uniffi::Enum)]
pub enum GroupMessageKind {
Application = 1,
MembershipChange = 2,
pub enum FfiGroupMessageKind {
Application,
MembershipChange,
}

impl GroupMessageKind {
pub fn to_int(&self) -> i32 {
match self {
Self::Application => 1,
Self::MembershipChange => 2,
impl From<GroupMessageKind> for FfiGroupMessageKind {
fn from(kind: GroupMessageKind) -> Self {
match kind {
GroupMessageKind::Application => FfiGroupMessageKind::Application,
GroupMessageKind::MembershipChange => FfiGroupMessageKind::MembershipChange,
}
}
}
Expand All @@ -506,7 +506,7 @@ pub struct FfiMessage {
pub convo_id: Vec<u8>,
pub addr_from: String,
pub content: Vec<u8>,
pub kind: GroupMessageKind,
pub kind: FfiGroupMessageKind,
}

impl From<StoredGroupMessage> for FfiMessage {
Expand All @@ -517,7 +517,7 @@ impl From<StoredGroupMessage> for FfiMessage {
convo_id: msg.group_id,
addr_from: msg.sender_account_address,
content: msg.decrypted_message_bytes,
kind: msg.kind,
kind: msg.kind.into(),
}
}
}
Expand Down

0 comments on commit 0a0a5b2

Please sign in to comment.