diff --git a/src/chat.rs b/src/chat.rs
index 015a82000c..7c2a855a6b 100644
--- a/src/chat.rs
+++ b/src/chat.rs
@@ -2926,10 +2926,9 @@ pub(crate) async fn create_send_msg_jobs(context: &Context, msg: &mut Message) -
let now = time();
- if rendered_msg.last_added_location_id.is_some()
- && let Err(err) = location::set_kml_sent_timestamp(context, msg.chat_id, now).await
- {
- error!(context, "Failed to set kml sent_timestamp: {err:#}.");
+ if let Some(last_added_location_timestamp) = rendered_msg.last_added_location_timestamp {
+ location::set_kml_sent_timestamp(context, msg.chat_id, last_added_location_timestamp)
+ .await?;
}
if attach_selfavatar && let Err(err) = msg.chat_id.set_selfavatar_timestamp(context, now).await
diff --git a/src/location.rs b/src/location.rs
index 85ce22c386..cd575ac237 100644
--- a/src/location.rs
+++ b/src/location.rs
@@ -521,10 +521,9 @@ pub(crate) async fn delete_orphaned_poi(context: &Context) -> Result<()> {
Ok(())
}
-/// Returns `location.kml` contents.
-#[expect(clippy::arithmetic_side_effects)]
-pub async fn get_kml(context: &Context, chat_id: ChatId) -> Result