From be4c2b90ace6d976f665ce9bdfa6ff3210af523e Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 4 Jan 2025 05:06:04 +0000 Subject: [PATCH] Assert that number of timestamps equals sum of To and Chat-Group-Past-Members --- src/mimefactory.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mimefactory.rs b/src/mimefactory.rs index cd9ddc6bc2..8dd7d7850b 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -543,6 +543,11 @@ impl MimeFactory { for (name, addr) in &self.recipients { if let Some(email_to_remove) = email_to_remove { if email_to_remove == addr { + if name.is_empty() { + past_members.push(Address::new_mailbox(addr.clone())); + } else { + past_members.push(new_address_with_name(name, addr.clone())); + } continue; } } @@ -563,6 +568,11 @@ impl MimeFactory { } } + debug_assert!( + undisclosed_recipients + || self.member_timestamps.is_empty() + || to.len() + past_members.len() == self.member_timestamps.len() + ); if to.is_empty() { to.push(Address::new_group( "hidden-recipients".to_string(),