Skip to content

Commit

Permalink
reuse mutable metadata when assigning members
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronvoell committed May 30, 2024
1 parent e74ce1a commit f3c97a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xmtp_mls/src/groups/members.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ impl MlsGroup {

let conn = provider.conn_ref();
let association_state_map = StoredAssociationState::batch_read_from_cache(conn, &requests)?;
let mutable_metadata = self.mutable_metadata()?;
// TODO: Figure out what to do with missing members from the local DB. Do we go to the network? Load from identity updates?
// Right now I am just omitting them
let members = association_state_map
.into_iter()
.map(|association_state| {
let inbox_id_str = association_state.inbox_id().to_string();
let is_admin = self.is_admin(inbox_id_str.clone())?;
let is_super_admin = self.is_super_admin(inbox_id_str.clone())?;
let is_admin = mutable_metadata.is_admin(&inbox_id_str);
let is_super_admin = mutable_metadata.is_super_admin(&inbox_id_str);
let permission_level = if is_super_admin {
PermissionLevel::SuperAdmin
} else if is_admin {
Expand Down

0 comments on commit f3c97a0

Please sign in to comment.