From f8cf57c1fbdb0a34edc846c20d03078f874b3856 Mon Sep 17 00:00:00 2001 From: morguldir Date: Fri, 30 Aug 2024 11:39:14 +0200 Subject: [PATCH] syncv3: fix bump types and only set timestamp if we find an event --- src/api/client/sync.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/client/sync.rs b/src/api/client/sync.rs index 46ac11c1..b99dc5e8 100644 --- a/src/api/client/sync.rs +++ b/src/api/client/sync.rs @@ -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, @@ -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; } }