@@ -132,19 +132,12 @@ async fn test_create_verified_oneonone_chat() -> Result<()> {
132132 tcm. send_recv ( & fiona_new, & alice, "I have a new device" )
133133 . await ;
134134
135- // Alice gets a new unprotected chat with new Fiona contact.
135+ // Alice gets a new chat with new Fiona contact.
136136 {
137137 let chat = alice. get_chat ( & fiona_new) . await ;
138- assert ! ( !chat. is_protected( ) ) ;
139138
140139 let msg = get_chat_msg ( & alice, chat. id , 1 , E2EE_INFO_MSGS + 1 ) . await ;
141140 assert_eq ! ( msg. text, "I have a new device" ) ;
142-
143- // After recreating the chat, it should still be unprotected
144- chat. id . delete ( & alice) . await ?;
145-
146- let chat = alice. create_chat ( & fiona_new) . await ;
147- assert ! ( !chat. is_protected( ) ) ;
148141 }
149142
150143 Ok ( ( ) )
@@ -179,42 +172,6 @@ async fn test_missing_key_reexecute_securejoin() -> Result<()> {
179172 Ok ( ( ) )
180173}
181174
182- #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
183- async fn test_create_unverified_oneonone_chat ( ) -> Result < ( ) > {
184- let mut tcm = TestContextManager :: new ( ) ;
185- let alice = tcm. alice ( ) . await ;
186- let bob = tcm. bob ( ) . await ;
187- enable_verified_oneonone_chats ( & [ & alice, & bob] ) . await ;
188-
189- // A chat with an unknown contact should be created unprotected
190- let chat = alice. create_chat ( & bob) . await ;
191- assert ! ( !chat. is_protected( ) ) ;
192-
193- receive_imf (
194- & alice,
195- b"From: Bob <[email protected] >\n \ 196- 197- Message-ID: <[email protected] >\n \ 198- \n \
199- hello\n ",
200- false ,
201- )
202- . await ?;
203-
204- chat. id . delete ( & alice) . await . unwrap ( ) ;
205- // Now Bob is a known contact, new chats should still be created unprotected
206- let chat = alice. create_chat ( & bob) . await ;
207- assert ! ( !chat. is_protected( ) ) ;
208-
209- tcm. send_recv ( & bob, & alice, "hi" ) . await ;
210- chat. id . delete ( & alice) . await . unwrap ( ) ;
211- // Now we have a public key, new chats should still be created unprotected
212- let chat = alice. create_chat ( & bob) . await ;
213- assert ! ( !chat. is_protected( ) ) ;
214-
215- Ok ( ( ) )
216- }
217-
218175/// Tests that receiving unencrypted message
219176/// does not disable protection of 1:1 chat.
220177///
@@ -229,7 +186,6 @@ async fn test_degrade_verified_oneonone_chat() -> Result<()> {
229186 mark_as_verified ( & alice, & bob) . await ;
230187
231188 let alice_chat = alice. create_chat ( & bob) . await ;
232- assert ! ( alice_chat. is_protected( ) ) ;
233189
234190 receive_imf (
235191 & alice,
@@ -496,8 +452,6 @@ async fn test_message_from_old_dc_setup() -> Result<()> {
496452 // The outdated Bob's Autocrypt header isn't applied
497453 // and the message goes to another chat, so the verification preserves.
498454 assert ! ( contact. is_verified( alice) . await . unwrap( ) ) ;
499- let chat = alice. get_chat ( bob) . await ;
500- assert ! ( chat. is_protected( ) ) ;
501455 Ok ( ( ) )
502456}
503457
@@ -602,9 +556,9 @@ async fn test_verified_member_added_reordering() -> Result<()> {
602556 // "Member added" message, so unverified group is created.
603557 let fiona_received_message = fiona. recv_msg ( & bob_sent_message) . await ;
604558 let fiona_chat = Chat :: load_from_db ( fiona, fiona_received_message. chat_id ) . await ?;
559+ assert ! ( !fiona_chat. can_send( fiona) . await ?) ;
605560
606561 assert_eq ! ( fiona_received_message. get_text( ) , "Hi" ) ;
607- assert_eq ! ( fiona_chat. is_protected( ) , false ) ;
608562
609563 // Fiona receives late "Member added" message
610564 // and the chat becomes protected.
0 commit comments