Skip to content

Commit 6eb0571

Browse files
committed
Fix construction of Chat-Group-Member-Timestamps
1 parent 15b7340 commit 6eb0571

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/mimefactory.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ impl MimeFactory {
217217
Ok((authname, addr, id, add_timestamp, remove_timestamp))
218218
},
219219
|rows| {
220+
let mut past_member_timestamps = Vec::new();
221+
220222
for row in rows {
221223
let (authname, addr, id, add_timestamp, remove_timestamp) = row?;
222224
let addr = if id == ContactId::SELF {
@@ -232,15 +234,8 @@ impl MimeFactory {
232234
if !recipients_contain_addr(&to, &addr) {
233235
recipients.push(addr.clone());
234236
if !undisclosed_recipients {
235-
if let Some(email_to_remove) = email_to_remove {
236-
if email_to_remove != addr {
237-
to.push((name, addr));
238-
member_timestamps.push(add_timestamp);
239-
}
240-
} else {
241-
to.push((name, addr));
242-
member_timestamps.push(add_timestamp);
243-
}
237+
to.push((name, addr));
238+
member_timestamps.push(add_timestamp);
244239
}
245240
}
246241
recipient_ids.insert(id);
@@ -258,11 +253,13 @@ impl MimeFactory {
258253
}
259254
if !undisclosed_recipients {
260255
past_members.push((name, addr));
261-
member_timestamps.push(remove_timestamp);
256+
past_member_timestamps.push(remove_timestamp);
262257
}
263258
}
264259
}
265260
}
261+
262+
member_timestamps.extend(past_member_timestamps);
266263
Ok(())
267264
},
268265
)

0 commit comments

Comments
 (0)