Skip to content

Commit

Permalink
Do not accept timestamps from the future
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Jan 7, 2025
1 parent 2f93ea9 commit b1aec86
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mimeparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use crate::param::{Param, Params};
use crate::peerstate::Peerstate;
use crate::simplify::{simplify, SimplifiedText};
use crate::sync::SyncItems;
use crate::tools::time;
use crate::tools::{
get_filemeta, parse_receive_headers, smeared_time, truncate_msg_text, validate_id,
};
Expand Down Expand Up @@ -1864,10 +1865,12 @@ impl MimeMessage {
///
/// Returns `None` if there is no such header.
pub async fn chat_group_member_timestamps(&self) -> Option<Vec<i64>> {
let now = time();
self.get_header(HeaderDef::ChatGroupMemberTimestamps)
.map(|h| {
h.split_ascii_whitespace()
.filter_map(|ts| ts.parse::<i64>().ok())
.map(|ts| std::cmp::min(now, ts))
.collect()
})
}
Expand Down

0 comments on commit b1aec86

Please sign in to comment.