@@ -3547,6 +3547,32 @@ async fn test_mua_user_adds_recipient_to_single_chat() -> Result<()> {
35473547 Ok ( ( ) )
35483548}
35493549
3550+ /// If a message is Autocrypt-encrypted, unsigned Chat-Group-* headers have no effect.
3551+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
3552+ async fn test_unsigned_chat_group_hdr ( ) -> Result < ( ) > {
3553+ let mut tcm = TestContextManager :: new ( ) ;
3554+ let alice = & tcm. alice ( ) . await ;
3555+ let bob = & tcm. bob ( ) . await ;
3556+ let bob_addr = bob. get_config ( Config :: Addr ) . await ?. unwrap ( ) ;
3557+ let bob_id = Contact :: create ( alice, "Bob" , & bob_addr) . await ?;
3558+ let alice_chat_id = create_group_chat ( alice, ProtectionStatus :: Unprotected , "foos" ) . await ?;
3559+ add_contact_to_chat ( alice, alice_chat_id, bob_id) . await ?;
3560+ send_text_msg ( alice, alice_chat_id, "populate" . to_string ( ) ) . await ?;
3561+ let sent_msg = alice. pop_sent_msg ( ) . await ;
3562+ let bob_chat_id = bob. recv_msg ( & sent_msg) . await . chat_id ;
3563+ bob_chat_id. accept ( bob) . await ?;
3564+ send_text_msg ( bob, bob_chat_id, "hi all!" . to_string ( ) ) . await ?;
3565+ let mut sent_msg = bob. pop_sent_msg ( ) . await ;
3566+ sent_msg. payload = sent_msg. payload . replace (
3567+ "Chat-Version:" ,
3568+ & format ! ( "Chat-Group-Member-Removed: {bob_addr}\r \n Chat-Version:" ) ,
3569+ ) ;
3570+ let chat_id = alice. recv_msg ( & sent_msg) . await . chat_id ;
3571+ assert_eq ! ( chat_id, alice_chat_id) ;
3572+ assert_eq ! ( get_chat_contacts( alice, alice_chat_id) . await ?. len( ) , 2 ) ;
3573+ Ok ( ( ) )
3574+ }
3575+
35503576#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
35513577async fn test_sync_member_list_on_rejoin ( ) -> Result < ( ) > {
35523578 let mut tcm = TestContextManager :: new ( ) ;
0 commit comments