@@ -132,19 +132,12 @@ async fn test_create_verified_oneonone_chat() -> Result<()> {
132
132
tcm. send_recv ( & fiona_new, & alice, "I have a new device" )
133
133
. await ;
134
134
135
- // Alice gets a new unprotected chat with new Fiona contact.
135
+ // Alice gets a new chat with new Fiona contact.
136
136
{
137
137
let chat = alice. get_chat ( & fiona_new) . await ;
138
- assert ! ( !chat. is_protected( ) ) ;
139
138
140
139
let msg = get_chat_msg ( & alice, chat. id , 1 , E2EE_INFO_MSGS + 1 ) . await ;
141
140
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( ) ) ;
148
141
}
149
142
150
143
Ok ( ( ) )
@@ -179,42 +172,6 @@ async fn test_missing_key_reexecute_securejoin() -> Result<()> {
179
172
Ok ( ( ) )
180
173
}
181
174
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
-
218
175
/// Tests that receiving unencrypted message
219
176
/// does not disable protection of 1:1 chat.
220
177
///
@@ -229,7 +186,6 @@ async fn test_degrade_verified_oneonone_chat() -> Result<()> {
229
186
mark_as_verified ( & alice, & bob) . await ;
230
187
231
188
let alice_chat = alice. create_chat ( & bob) . await ;
232
- assert ! ( alice_chat. is_protected( ) ) ;
233
189
234
190
receive_imf (
235
191
& alice,
@@ -496,8 +452,6 @@ async fn test_message_from_old_dc_setup() -> Result<()> {
496
452
// The outdated Bob's Autocrypt header isn't applied
497
453
// and the message goes to another chat, so the verification preserves.
498
454
assert ! ( contact. is_verified( alice) . await . unwrap( ) ) ;
499
- let chat = alice. get_chat ( bob) . await ;
500
- assert ! ( chat. is_protected( ) ) ;
501
455
Ok ( ( ) )
502
456
}
503
457
@@ -602,9 +556,9 @@ async fn test_verified_member_added_reordering() -> Result<()> {
602
556
// "Member added" message, so unverified group is created.
603
557
let fiona_received_message = fiona. recv_msg ( & bob_sent_message) . await ;
604
558
let fiona_chat = Chat :: load_from_db ( fiona, fiona_received_message. chat_id ) . await ?;
559
+ assert ! ( !fiona_chat. can_send( fiona) . await ?) ;
605
560
606
561
assert_eq ! ( fiona_received_message. get_text( ) , "Hi" ) ;
607
- assert_eq ! ( fiona_chat. is_protected( ) , false ) ;
608
562
609
563
// Fiona receives late "Member added" message
610
564
// and the chat becomes protected.
0 commit comments