Skip to content

Commit

Permalink
Cleanup StagedWelcome
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieobject committed Mar 26, 2024
1 parent 2b03bcd commit ef47a3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 1 addition & 3 deletions bindings_ffi/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,13 @@ where
provider: &XmtpOpenMlsProvider,
welcome: MlsWelcome,
) -> Result<Self, GroupError> {
let mut mls_welcome =
// EM: Fix error handling here
StagedWelcome::new_from_welcome(provider, &build_group_join_config(), welcome, None)
.expect("Error creating staged join from Welcome")
.into_group(provider)?;

mls_welcome.save(provider.key_store())?;
let group_id = mls_welcome.group_id().to_vec();
let mls_welcome =
StagedWelcome::new_from_welcome(provider, &build_group_join_config(), welcome, None)?;

let mut mls_group = mls_welcome.into_group(provider)?;
mls_group.save(provider.key_store())?;

let group_id = mls_group.group_id().to_vec();
let to_store = StoredGroup::new(group_id, now_ns(), GroupMembershipState::Pending);
let stored_group = provider.conn().insert_or_ignore_group(to_store)?;

Expand Down

0 comments on commit ef47a3f

Please sign in to comment.