Skip to content

Commit

Permalink
Sync dms, and update hmac (#1442)
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink authored Dec 20, 2024
1 parent 320aace commit 33c06af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions xmtp_mls/src/groups/device_sync/message_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ where
&self,
conn: &DbConnection,
) -> Result<Vec<Syncable>, DeviceSyncError> {
let groups =
conn.find_groups(GroupQueryArgs::default().conversation_type(ConversationType::Group))?;
let groups = conn.find_groups(GroupQueryArgs::default())?;

let mut all_messages = vec![];
for StoredGroup { id, .. } in groups.into_iter() {
Expand Down
7 changes: 5 additions & 2 deletions xmtp_mls/src/groups/mls_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,9 @@ where
intent.id
);

let messages = self.prepare_group_messages(vec![payload_slice])?;self.client
let messages = self.prepare_group_messages(vec![payload_slice])?;

self.client
.api()
.send_group_messages(messages)
.await?;
Expand Down Expand Up @@ -1464,7 +1466,8 @@ where
let mut result = vec![];
for payload in payloads {
let mut sender_hmac = sender_hmac.clone();
sender_hmac.update(payload);
// When we switch to V2, update with the header bytes.
sender_hmac.update(&[]);
let sender_hmac = sender_hmac.finalize();

result.push(GroupMessageInput {
Expand Down

0 comments on commit 33c06af

Please sign in to comment.