File tree Expand file tree Collapse file tree 2 files changed +29
-19
lines changed Expand file tree Collapse file tree 2 files changed +29
-19
lines changed Original file line number Diff line number Diff line change @@ -2495,7 +2495,9 @@ async fn test_broadcast() -> Result<()> {
2495
2495
}
2496
2496
2497
2497
{
2498
- let msg = bob. recv_msg ( & alice. pop_sent_msg ( ) . await ) . await ;
2498
+ let sent_msg = alice. pop_sent_msg ( ) . await ;
2499
+ assert ! ( !sent_msg. payload. contains( "Chat-Group-Member-Timestamps:" ) ) ;
2500
+ let msg = bob. recv_msg ( & sent_msg) . await ;
2499
2501
assert_eq ! ( msg. get_text( ) , "ola!" ) ;
2500
2502
assert_eq ! ( msg. subject, "Broadcast list" ) ;
2501
2503
assert ! ( !msg. get_showpadlock( ) ) ; // avoid leaking recipients in encryption data
@@ -3536,3 +3538,12 @@ async fn test_restore_backup_after_60_days() -> Result<()> {
3536
3538
3537
3539
Ok ( ( ) )
3538
3540
}
3541
+
3542
+ #[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
3543
+ async fn test_one_to_one_chat_no_group_member_timestamps ( ) {
3544
+ let t = TestContext :: new_alice ( ) . await ;
3545
+ let chat = t. create_chat_with_contact ( "bob" , "bob@example.com" ) . await ;
3546
+ let sent = t. send_text ( chat. id , "Hi!" ) . await ;
3547
+ let payload = sent. payload ;
3548
+ assert ! ( !payload. contains( "Chat-Group-Member-Timestamps:" ) ) ;
3549
+ }
Original file line number Diff line number Diff line change @@ -622,24 +622,23 @@ impl MimeFactory {
622
622
) ;
623
623
}
624
624
625
- let chat_memberlist_is_stale = if let Loaded :: Message { chat, .. } = & self . loaded {
626
- chat. member_list_is_stale ( context) . await ?
627
- } else {
628
- false
629
- } ;
630
-
631
- if !self . member_timestamps . is_empty ( ) && !chat_memberlist_is_stale {
632
- headers. push (
633
- Header :: new_with_value (
634
- "Chat-Group-Member-Timestamps" . into ( ) ,
635
- self . member_timestamps
636
- . iter ( )
637
- . map ( |ts| ts. to_string ( ) )
638
- . collect :: < Vec < String > > ( )
639
- . join ( " " ) ,
640
- )
641
- . unwrap ( ) ,
642
- ) ;
625
+ if let Loaded :: Message { chat, .. } = & self . loaded {
626
+ if chat. typ == Chattype :: Group
627
+ && !self . member_timestamps . is_empty ( )
628
+ && !chat. member_list_is_stale ( context) . await ?
629
+ {
630
+ headers. push (
631
+ Header :: new_with_value (
632
+ "Chat-Group-Member-Timestamps" . into ( ) ,
633
+ self . member_timestamps
634
+ . iter ( )
635
+ . map ( |ts| ts. to_string ( ) )
636
+ . collect :: < Vec < String > > ( )
637
+ . join ( " " ) ,
638
+ )
639
+ . unwrap ( ) ,
640
+ ) ;
641
+ }
643
642
}
644
643
645
644
let subject_str = self . subject_str ( context) . await ?;
You can’t perform that action at this time.
0 commit comments