Skip to content

Commit

Permalink
syncv3: check timestamps of all the rooms in the timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
morguldir committed Aug 30, 2024
1 parent f8cf57c commit bf9d498
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/client/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1549,9 +1549,9 @@ pub(crate) async fn sync_events_v4_route(

let mut timestamp: Option<_> = None;
for (_, pdu) in timeline_pdus {
if DEFAULT_BUMP_TYPES.contains(pdu.event_type()) {
timestamp = Some(MilliSecondsSinceUnixEpoch(pdu.origin_server_ts));
break;
let ts = MilliSecondsSinceUnixEpoch(pdu.origin_server_ts);
if DEFAULT_BUMP_TYPES.contains(pdu.event_type()) && !timestamp.is_some_and(|time| time > ts) {
timestamp = Some(ts);
}
}

Expand Down

0 comments on commit bf9d498

Please sign in to comment.