From 0cb22996be02f38dff2e049cfeae351f607aeb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Sat, 14 Aug 2021 19:47:16 +0200 Subject: [PATCH] remove prev event fetch limit --- src/server_server.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/server_server.rs b/src/server_server.rs index 0c226ac..cbbb850 100644 --- a/src/server_server.rs +++ b/src/server_server.rs @@ -1016,10 +1016,11 @@ pub fn handle_incoming_pdu<'a>( // 8. if not timeline event: stop if !is_timeline_event || incoming_pdu.origin_server_ts - < (utils::millis_since_unix_epoch() - 1000 * 60 * 20) - .try_into() - .expect("time is valid") - // Not older than 20 mins + < db.rooms + .first_pdu_in_room(&room_id) + .map_err(|_| "Error loading first room event.".to_owned())? + .expect("Room exists") + .origin_server_ts { let elapsed = start_time.elapsed(); warn!( @@ -1031,6 +1032,7 @@ pub fn handle_incoming_pdu<'a>( return Ok(None); } + // TODO: make not recursive // 9. Fetch any missing prev events doing all checks listed here starting at 1. These are timeline events fetch_and_handle_events( db,