File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -510,6 +510,7 @@ impl MimeFactory {
510510 } ;
511511
512512 let mut to = Vec :: new ( ) ;
513+ let mut past_members = Vec :: new ( ) ; // Contents of `Chat-Group-Past-Members` header.
513514 if undisclosed_recipients {
514515 to. push ( Address :: new_group (
515516 "hidden-recipients" . to_string ( ) ,
@@ -541,6 +542,14 @@ impl MimeFactory {
541542 }
542543 }
543544
545+ for ( name, addr) in & self . past_members {
546+ if name. is_empty ( ) {
547+ past_members. push ( Address :: new_mailbox ( addr. clone ( ) ) ) ;
548+ } else {
549+ past_members. push ( new_address_with_name ( name, addr. clone ( ) ) ) ;
550+ }
551+ }
552+
544553 if to. is_empty ( ) {
545554 to. push ( from. clone ( ) ) ;
546555 }
@@ -556,6 +565,9 @@ impl MimeFactory {
556565 headers. push ( Header :: new_with_value ( "Sender" . into ( ) , vec ! [ sender] ) . unwrap ( ) ) ;
557566 }
558567 headers. push ( Header :: new_with_value ( "To" . into ( ) , to. clone ( ) ) . unwrap ( ) ) ;
568+ if !past_members. is_empty ( ) {
569+ headers. push ( Header :: new_with_value ( "Chat-Group-Past-Members" . into ( ) , to. clone ( ) ) . unwrap ( ) ) ;
570+ }
559571
560572 let subject_str = self . subject_str ( context) . await ?;
561573 let encoded_subject = if subject_str
You can’t perform that action at this time.
0 commit comments