diff --git a/bindings_ffi/src/mls.rs b/bindings_ffi/src/mls.rs index 4ac46b3c1..5540c48f4 100644 --- a/bindings_ffi/src/mls.rs +++ b/bindings_ffi/src/mls.rs @@ -534,24 +534,6 @@ impl FfiXmtpClient { scw_verifier: self.inner_client.scw_verifier().clone().clone(), })) } - - pub fn get_hmac_keys(&self) -> Result, GenericError> { - let inner = self.inner_client.as_ref(); - let conversations = inner.find_groups(GroupQueryArgs::default())?; - - let mut keys = vec![]; - for conversation in conversations { - let mut k = conversation - .hmac_keys(-1..=1)? - .into_iter() - .map(Into::into) - .collect::>(); - - keys.append(&mut k); - } - - Ok(keys) - } } impl From for FfiHmacKey { @@ -1110,6 +1092,25 @@ impl FfiConversations { FfiStreamCloser::new(handle) } + + pub fn get_hmac_keys(&self) -> Result, Vec>, GenericError> { + let inner = self.inner_client.as_ref(); + let conversations = inner.find_groups(GroupQueryArgs::default())?; + + let mut hmac_map = HashMap::new(); + for conversation in conversations { + let id = conversation.group_id.clone(); + let mut keys = conversation + .hmac_keys(-1..=1)? + .into_iter() + .map(Into::into) + .collect::>(); + + hmac_map.insert(id, keys); + } + + Ok(hmac_map) + } } impl From for ConversationType {