Skip to content

Commit be4c2b9

Browse files
committed
Assert that number of timestamps equals sum of To and Chat-Group-Past-Members
1 parent 64bbd7e commit be4c2b9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/mimefactory.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,11 @@ impl MimeFactory {
543543
for (name, addr) in &self.recipients {
544544
if let Some(email_to_remove) = email_to_remove {
545545
if email_to_remove == addr {
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+
}
546551
continue;
547552
}
548553
}
@@ -563,6 +568,11 @@ impl MimeFactory {
563568
}
564569
}
565570

571+
debug_assert!(
572+
undisclosed_recipients
573+
|| self.member_timestamps.is_empty()
574+
|| to.len() + past_members.len() == self.member_timestamps.len()
575+
);
566576
if to.is_empty() {
567577
to.push(Address::new_group(
568578
"hidden-recipients".to_string(),

0 commit comments

Comments
 (0)