Skip to content

Commit

Permalink
use time window as expected by current .xdc
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed Apr 12, 2024
1 parent 75a6027 commit c1c9fd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/webxdc/maps_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use crate::message::{Message, MsgId, Viewtype};
use crate::chat::ChatId;
use crate::color::color_int_to_hex_string;
use crate::contact::{Contact, ContactId};
use crate::tools::time;
use crate::webxdc::{StatusUpdateItem, StatusUpdateItemAndSerial, StatusUpdateSerial};
use anyhow::Result;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -103,7 +104,8 @@ pub(crate) async fn intercept_get_updates(
let mut json = String::default();
let mut contact_data: HashMap<ContactId, (String, String)> = HashMap::new();

let locations = location::get_range(context, chat_id, None, 0, 0).await?;
let begin = time() - 24 * 60 * 60;
let locations = location::get_range(context, chat_id, None, begin, 0).await?;
for location in locations.iter().rev() {
if location.location_id > last_known_serial.to_u32() {
let (name, color) = match contact_data.entry(location.contact_id) {
Expand Down

0 comments on commit c1c9fd2

Please sign in to comment.