@@ -498,6 +498,30 @@ def test_forward_messages(acfactory, lp):
498
498
assert not chat3 .get_messages ()
499
499
500
500
501
+ def test_forward_encrypted_to_unencrypted (acfactory , lp ):
502
+ ac1 , ac2 , ac3 = acfactory .get_online_accounts (3 )
503
+ chat = acfactory .get_accepted_chat (ac1 , ac2 )
504
+
505
+ lp .sec ("ac1: send unencrypted message to ac2" )
506
+ txt = "This is still unencrypted"
507
+ chat .send_text (txt )
508
+ msg = ac2 .wait_next_incoming_message ()
509
+ assert msg .text == txt
510
+ assert not msg .is_encrypted ()
511
+
512
+ lp .sec ("ac2: send encrypted message to ac1" )
513
+ txt = "This should be encrypted now"
514
+ msg .chat .send_text (txt )
515
+ msg2 = ac1 .wait_next_incoming_message ()
516
+ assert msg2 .is_encrypted ()
517
+
518
+ lp .sec ("ac1: forward message to ac3 unencrypted " )
519
+ unencrypted_chat = ac1 .create_chat (ac3 )
520
+ msg3 = unencrypted_chat .send_msg (msg )
521
+ assert not msg3 .is_encrypted ()
522
+ assert msg2 .is_encrypted ()
523
+
524
+
501
525
def test_forward_own_message (acfactory , lp ):
502
526
ac1 , ac2 = acfactory .get_online_accounts (2 )
503
527
chat = acfactory .get_accepted_chat (ac1 , ac2 )
0 commit comments