Commit 1c5c59f 1 parent a0791f0 commit 1c5c59f Copy full SHA for 1c5c59f
File tree 1 file changed +19
-18
lines changed
1 file changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -534,24 +534,6 @@ impl FfiXmtpClient {
534
534
scw_verifier : self . inner_client . scw_verifier ( ) . clone ( ) . clone ( ) ,
535
535
} ) )
536
536
}
537
-
538
- pub fn get_hmac_keys ( & self ) -> Result < Vec < FfiHmacKey > , GenericError > {
539
- let inner = self . inner_client . as_ref ( ) ;
540
- let conversations = inner. find_groups ( GroupQueryArgs :: default ( ) ) ?;
541
-
542
- let mut keys = vec ! [ ] ;
543
- for conversation in conversations {
544
- let mut k = conversation
545
- . hmac_keys ( -1 ..=1 ) ?
546
- . into_iter ( )
547
- . map ( Into :: into)
548
- . collect :: < Vec < _ > > ( ) ;
549
-
550
- keys. append ( & mut k) ;
551
- }
552
-
553
- Ok ( keys)
554
- }
555
537
}
556
538
557
539
impl From < HmacKey > for FfiHmacKey {
@@ -1110,6 +1092,25 @@ impl FfiConversations {
1110
1092
1111
1093
FfiStreamCloser :: new ( handle)
1112
1094
}
1095
+
1096
+ pub fn get_hmac_keys ( & self ) -> Result < HashMap < Vec < u8 > , Vec < FfiHmacKey > > , GenericError > {
1097
+ let inner = self . inner_client . as_ref ( ) ;
1098
+ let conversations = inner. find_groups ( GroupQueryArgs :: default ( ) ) ?;
1099
+
1100
+ let mut hmac_map = HashMap :: new ( ) ;
1101
+ for conversation in conversations {
1102
+ let id = conversation. group_id . clone ( ) ;
1103
+ let keys = conversation
1104
+ . hmac_keys ( -1 ..=1 ) ?
1105
+ . into_iter ( )
1106
+ . map ( Into :: into)
1107
+ . collect :: < Vec < _ > > ( ) ;
1108
+
1109
+ hmac_map. insert ( id, keys) ;
1110
+ }
1111
+
1112
+ Ok ( hmac_map)
1113
+ }
1113
1114
}
1114
1115
1115
1116
impl From < FfiConversationType > for ConversationType {
You can’t perform that action at this time.
0 commit comments