Skip to content

Commit

Permalink
update welcome
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Dec 18, 2024
1 parent 1438028 commit 91388a7
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions xmtp_mls/src/groups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,15 +511,9 @@ impl<ScopedClient: ScopedGroupClient> MlsGroup<ScopedClient> {
let group_id = mls_group.group_id().to_vec();
let metadata = extract_group_metadata(&mls_group)?;
let dm_members = metadata.dm_members;
let dm_inbox_id = if let Some(dm_members) = &dm_members {
if dm_members.member_one_inbox_id == client.inbox_id() {
Some(dm_members.member_two_inbox_id.clone())
} else {
Some(dm_members.member_one_inbox_id.clone())
}
} else {
None
};
let dm_id =
dm_members.map(|m| DmId::from_ids([&m.member_one_inbox_id, &m.member_two_inbox_id]));

let conversation_type = metadata.conversation_type;

let to_store = match conversation_type {
Expand All @@ -530,7 +524,7 @@ impl<ScopedClient: ScopedGroupClient> MlsGroup<ScopedClient> {
added_by_inbox,
welcome_id,
conversation_type,
dm_inbox_id,
dm_id,
),
ConversationType::Dm => {
validate_dm_group(client.as_ref(), &mls_group, &added_by_inbox)?;
Expand All @@ -541,7 +535,7 @@ impl<ScopedClient: ScopedGroupClient> MlsGroup<ScopedClient> {
added_by_inbox,
welcome_id,
conversation_type,
dm_inbox_id,
dm_id,
)
}
ConversationType::Sync => StoredGroup::new_from_welcome(
Expand All @@ -551,7 +545,7 @@ impl<ScopedClient: ScopedGroupClient> MlsGroup<ScopedClient> {
added_by_inbox,
welcome_id,
conversation_type,
dm_inbox_id,
dm_id,
),
};

Expand Down

0 comments on commit 91388a7

Please sign in to comment.