From 85739ba6ad7d3a3c9a39f991656b832d998cb56c Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 28 Jul 2023 16:01:31 +0000 Subject: [PATCH] refactor: make last_added_location_id an Option --- src/chat.rs | 5 ++--- src/mimefactory.rs | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 705f5dbfc..dc9896397 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -2389,14 +2389,13 @@ async fn create_send_msg_job(context: &Context, msg_id: MsgId) -> Result { in_reply_to: String, references: String, req_mdn: bool, - last_added_location_id: u32, + last_added_location_id: Option, /// If the created mime-structure contains sync-items, /// the IDs of these items are listed here. @@ -85,7 +85,7 @@ pub struct RenderedEmail { // pub envelope: Envelope, pub is_encrypted: bool, pub is_gossiped: bool, - pub last_added_location_id: u32, + pub last_added_location_id: Option, /// A comma-separated string of sync-IDs that are used by the rendered email /// and must be deleted once the message is actually queued for sending @@ -223,7 +223,7 @@ impl<'a> MimeFactory<'a> { in_reply_to, references, req_mdn, - last_added_location_id: 0, + last_added_location_id: None, sync_ids_to_delete: None, attach_selfavatar, }; @@ -264,7 +264,7 @@ impl<'a> MimeFactory<'a> { in_reply_to: String::default(), references: String::default(), req_mdn: false, - last_added_location_id: 0, + last_added_location_id: None, sync_ids_to_delete: None, attach_selfavatar: false, }; @@ -876,7 +876,7 @@ impl<'a> MimeFactory<'a> { .body(kml_content); if !self.msg.param.exists(Param::SetLatitude) { // otherwise, the independent location is already filed - self.last_added_location_id = last_added_location_id; + self.last_added_location_id = Some(last_added_location_id); } Ok(part) }