From 33c06af6b816d96b92a0292bb57f1a44430a3462 Mon Sep 17 00:00:00 2001 From: Dakota Brink <779390+codabrink@users.noreply.github.com> Date: Fri, 20 Dec 2024 12:34:43 -0500 Subject: [PATCH] Sync dms, and update hmac (#1442) --- xmtp_mls/src/groups/device_sync/message_sync.rs | 3 +-- xmtp_mls/src/groups/mls_sync.rs | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/xmtp_mls/src/groups/device_sync/message_sync.rs b/xmtp_mls/src/groups/device_sync/message_sync.rs index 053dea448..c4236405c 100644 --- a/xmtp_mls/src/groups/device_sync/message_sync.rs +++ b/xmtp_mls/src/groups/device_sync/message_sync.rs @@ -27,8 +27,7 @@ where &self, conn: &DbConnection, ) -> Result, 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() { diff --git a/xmtp_mls/src/groups/mls_sync.rs b/xmtp_mls/src/groups/mls_sync.rs index 4550abfc3..f9bcba57a 100644 --- a/xmtp_mls/src/groups/mls_sync.rs +++ b/xmtp_mls/src/groups/mls_sync.rs @@ -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?; @@ -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 {