@@ -129,19 +129,12 @@ async fn test_create_verified_oneonone_chat() -> Result<()> {
129129 tcm. send_recv ( & fiona_new, & alice, "I have a new device" )
130130 . await ;
131131
132- // Alice gets a new unprotected chat with new Fiona contact.
132+ // Alice gets a new chat with new Fiona contact.
133133 {
134134 let chat = alice. get_chat ( & fiona_new) . await ;
135- assert ! ( !chat. is_protected( ) ) ;
136135
137136 let msg = get_chat_msg ( & alice, chat. id , 1 , E2EE_INFO_MSGS + 1 ) . await ;
138137 assert_eq ! ( msg. text, "I have a new device" ) ;
139-
140- // After recreating the chat, it should still be unprotected
141- chat. id . delete ( & alice) . await ?;
142-
143- let chat = alice. create_chat ( & fiona_new) . await ;
144- assert ! ( !chat. is_protected( ) ) ;
145138 }
146139
147140 Ok ( ( ) )
@@ -175,41 +168,6 @@ async fn test_missing_key_reexecute_securejoin() -> Result<()> {
175168 Ok ( ( ) )
176169}
177170
178- #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
179- async fn test_create_unverified_oneonone_chat ( ) -> Result < ( ) > {
180- let mut tcm = TestContextManager :: new ( ) ;
181- let alice = tcm. alice ( ) . await ;
182- let bob = tcm. bob ( ) . await ;
183-
184- // A chat with an unknown contact should be created unprotected
185- let chat = alice. create_chat ( & bob) . await ;
186- assert ! ( !chat. is_protected( ) ) ;
187-
188- receive_imf (
189- & alice,
190- b"From: Bob <bob@example.net>\n \
191- To: alice@example.org\n \
192- Message-ID: <1234-2@example.org>\n \
193- \n \
194- hello\n ",
195- false ,
196- )
197- . await ?;
198-
199- chat. id . delete ( & alice) . await . unwrap ( ) ;
200- // Now Bob is a known contact, new chats should still be created unprotected
201- let chat = alice. create_chat ( & bob) . await ;
202- assert ! ( !chat. is_protected( ) ) ;
203-
204- tcm. send_recv ( & bob, & alice, "hi" ) . await ;
205- chat. id . delete ( & alice) . await . unwrap ( ) ;
206- // Now we have a public key, new chats should still be created unprotected
207- let chat = alice. create_chat ( & bob) . await ;
208- assert ! ( !chat. is_protected( ) ) ;
209-
210- Ok ( ( ) )
211- }
212-
213171/// Tests that receiving unencrypted message
214172/// does not disable protection of 1:1 chat.
215173///
@@ -223,7 +181,6 @@ async fn test_degrade_verified_oneonone_chat() -> Result<()> {
223181 mark_as_verified ( & alice, & bob) . await ;
224182
225183 let alice_chat = alice. create_chat ( & bob) . await ;
226- assert ! ( alice_chat. is_protected( ) ) ;
227184
228185 receive_imf (
229186 & alice,
@@ -484,8 +441,6 @@ async fn test_message_from_old_dc_setup() -> Result<()> {
484441 // The outdated Bob's Autocrypt header isn't applied
485442 // and the message goes to another chat, so the verification preserves.
486443 assert ! ( contact. is_verified( alice) . await . unwrap( ) ) ;
487- let chat = alice. get_chat ( bob) . await ;
488- assert ! ( chat. is_protected( ) ) ;
489444 Ok ( ( ) )
490445}
491446
@@ -587,9 +542,9 @@ async fn test_verified_member_added_reordering() -> Result<()> {
587542 // "Member added" message, so unverified group is created.
588543 let fiona_received_message = fiona. recv_msg ( & bob_sent_message) . await ;
589544 let fiona_chat = Chat :: load_from_db ( fiona, fiona_received_message. chat_id ) . await ?;
545+ assert ! ( !fiona_chat. can_send( fiona) . await ?) ;
590546
591547 assert_eq ! ( fiona_received_message. get_text( ) , "Hi" ) ;
592- assert_eq ! ( fiona_chat. is_protected( ) , false ) ;
593548
594549 // Fiona receives late "Member added" message
595550 // and the chat becomes protected.
0 commit comments