Skip to content

Commit

Permalink
add ffi updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed Apr 11, 2024
1 parent e233154 commit 9922a22
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,30 @@ impl FfiGroup {
Ok(())
}

pub async fn update_group_name(&self, group_name: String) -> Result<(), GenericError> {
let group = MlsGroup::new(
self.inner_client.as_ref(),
self.group_id.clone(),
self.created_at_ns,
);

group.update_group_metadata(group_name).await?;

Ok(())
}

pub async fn group_name(&self) -> Result<String, GenericError> {
let group = MlsGroup::new(
self.inner_client.as_ref(),
self.group_id.clone(),
self.created_at_ns,
);

let group_name = group.group_name().await?;

Ok(group_name)
}

pub async fn stream(
&self,
message_callback: Box<dyn FfiMessageCallback>,
Expand Down
10 changes: 10 additions & 0 deletions xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,16 @@ where
self.sync_until_intent_resolved(conn, intent.id).await
}

// Query the database for stored messages. Optionally filtered by time, kind, delivery_status
// and limit
pub fn group_name(
&self,
) -> Result<String, GroupError> {

let mutable_metadata = self.mutable_metadata()?;
Ok(mutable_metadata.group_name)
}

#[allow(dead_code)]
pub(crate) async fn remove_members_by_installation_id(
&self,
Expand Down

0 comments on commit 9922a22

Please sign in to comment.