Skip to content

Commit

Permalink
syncv3: fix bump types and only set timestamp if we find an event
Browse files Browse the repository at this point in the history
  • Loading branch information
morguldir committed Aug 30, 2024
1 parent 26a6d34 commit f8cf57c
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 @@ -45,8 +45,8 @@ use crate::{

const SINGLE_CONNECTION_SYNC: &str = "single_connection_sync";
const DEFAULT_BUMP_TYPES: &[TimelineEventType] = &[
TimelineEventType::Message,
TimelineEventType::Encrypted,
TimelineEventType::RoomMessage,
TimelineEventType::RoomEncrypted,
TimelineEventType::Sticker,
TimelineEventType::CallInvite,
TimelineEventType::PollStart,
Expand Down Expand Up @@ -1549,8 +1549,8 @@ pub(crate) async fn sync_events_v4_route(

let mut timestamp: Option<_> = None;
for (_, pdu) in timeline_pdus {
timestamp = Some(MilliSecondsSinceUnixEpoch(pdu.origin_server_ts));
if DEFAULT_BUMP_TYPES.contains(pdu.event_type()) {
timestamp = Some(MilliSecondsSinceUnixEpoch(pdu.origin_server_ts));
break;
}
}
Expand Down

0 comments on commit f8cf57c

Please sign in to comment.