diff --git a/src/chat.rs b/src/chat.rs
index 015a82000c..9db1f5cf2f 100644
--- a/src/chat.rs
+++ b/src/chat.rs
@@ -2839,7 +2839,6 @@ pub(crate) async fn create_send_msg_jobs(context: &Context, msg: &mut Message) -
return Err(err);
}
};
- let attach_selfavatar = mimefactory.attach_selfavatar;
let mut recipients = mimefactory.recipients();
let from = context.get_primary_self_addr().await?;
@@ -2926,15 +2925,20 @@ 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
+ if rendered_msg.avatar_is_attached
+ || rendered_pre_msg
+ .as_ref()
+ .is_some_and(|msg| msg.avatar_is_attached)
{
- error!(context, "Failed to set selfavatar timestamp: {err:#}.");
+ msg.chat_id
+ .set_selfavatar_timestamp(context, now)
+ .await
+ .context("Failed to set selfavatar timestamp")?;
}
if rendered_msg.is_encrypted {
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