syncv3: fix bump types and only set timestamp if we find an event
This commit is contained in:
parent
26a6d349dc
commit
f8cf57c1fb
1 changed files with 3 additions and 3 deletions
|
@ -45,8 +45,8 @@ use crate::{
|
||||||
|
|
||||||
const SINGLE_CONNECTION_SYNC: &str = "single_connection_sync";
|
const SINGLE_CONNECTION_SYNC: &str = "single_connection_sync";
|
||||||
const DEFAULT_BUMP_TYPES: &[TimelineEventType] = &[
|
const DEFAULT_BUMP_TYPES: &[TimelineEventType] = &[
|
||||||
TimelineEventType::Message,
|
TimelineEventType::RoomMessage,
|
||||||
TimelineEventType::Encrypted,
|
TimelineEventType::RoomEncrypted,
|
||||||
TimelineEventType::Sticker,
|
TimelineEventType::Sticker,
|
||||||
TimelineEventType::CallInvite,
|
TimelineEventType::CallInvite,
|
||||||
TimelineEventType::PollStart,
|
TimelineEventType::PollStart,
|
||||||
|
@ -1549,8 +1549,8 @@ pub(crate) async fn sync_events_v4_route(
|
||||||
|
|
||||||
let mut timestamp: Option<_> = None;
|
let mut timestamp: Option<_> = None;
|
||||||
for (_, pdu) in timeline_pdus {
|
for (_, pdu) in timeline_pdus {
|
||||||
timestamp = Some(MilliSecondsSinceUnixEpoch(pdu.origin_server_ts));
|
|
||||||
if DEFAULT_BUMP_TYPES.contains(pdu.event_type()) {
|
if DEFAULT_BUMP_TYPES.contains(pdu.event_type()) {
|
||||||
|
timestamp = Some(MilliSecondsSinceUnixEpoch(pdu.origin_server_ts));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue