Skip to content

Commit

Permalink
fix installations in xmptp_id
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Sep 25, 2024
1 parent 079cd92 commit 629443d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions xmtp_id/src/associations/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub struct AssociationStateDiff {

#[derive(Debug)]
pub struct Installation {
pub id: Vec<Vec<u8>>,
pub server_timestamp_ns: Option<i64>,
pub id: Vec<u8>,
pub client_timestamp_ns: Option<u64>,
}

impl AssociationStateDiff {
Expand Down Expand Up @@ -135,11 +135,14 @@ impl AssociationState {
}

pub fn installations(&self) -> Vec<Installation> {
self.members_by_kind(MemberKind::Installation)
self.members()
.into_iter()
.filter_map(|member| match member.identifier {
MemberIdentifier::Address(_) => None,
MemberIdentifier::Installation(installation_id) => Some(installation_id),
MemberIdentifier::Installation(id) => Some(Installation {
id,
client_timestamp_ns: member.client_timestamp_ns,
}),
})
.collect()
}
Expand Down

0 comments on commit 629443d

Please sign in to comment.