From 63364da79cd224001e2de715ccbe928912ff69a4 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 14 Sep 2026 08:31:19 +0200 Subject: [PATCH] chore: cleanup "primary" wording in comments --- src/config.rs | 14 +++++++------- src/events/payload.rs | 2 +- src/mimefactory.rs | 2 +- src/smtp.rs | 6 +++--- src/transport.rs | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/config.rs b/src/config.rs index dc0b99fe4..4c3c5686a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -195,9 +195,9 @@ pub enum Config { #[strum(props(default = "0"))] DeleteDeviceAfter, - /// The primary email address, used for sending and background fetch. + /// The address of the transport used for sending. /// - /// Device-local, other devices keep their own primary transport. + /// Device-local, other devices choose their own sending transport. ConfiguredAddr, /// Deprecated(2026-04). @@ -806,7 +806,7 @@ impl Context { (time(), addr), ) .context( - "Failed to update add_timestamp for the new primary transport", + "Failed to update add_timestamp for the new sending transport", )?; // Clean up SMTP queue. @@ -819,7 +819,8 @@ impl Context { Ok(()) }) .await?; - // Invalidate the cache so the sync message cannot read a stale primary address. + // Invalidate the cache so the sync message + // cannot read a stale sending address. self.sql.uncache_raw_config("configured_addr").await; send_sync_transports(self).await?; } @@ -917,8 +918,7 @@ impl Context { .any(|a| addr_cmp(addr, a))) } - /// Sets `primary_new` as the new primary self address and saves the old - /// primary address (if exists) as a secondary address. + /// Sets `primary_new` as the address used for sending. /// /// This should only be used by test code and during configure. #[cfg(test)] // AEAP is disabled, but there are still tests for it @@ -940,7 +940,7 @@ impl Context { .await } - /// Returns the primary self address. + /// Returns the address of the transport used for sending. /// Returns an error if no self addr is configured. pub async fn get_primary_self_addr(&self) -> Result { self.get_config(Config::ConfiguredAddr) diff --git a/src/events/payload.rs b/src/events/payload.rs index 383714a77..446ccf88e 100644 --- a/src/events/payload.rs +++ b/src/events/payload.rs @@ -433,7 +433,7 @@ pub enum EventType { chat_id: ChatId, }, - /// One or more transports has changed or another transport is primary now. + /// One or more transports has changed or another transport is used for sending now. /// /// UI should update the list. /// diff --git a/src/mimefactory.rs b/src/mimefactory.rs index 6bf1192a6..3d18644c9 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -2467,7 +2467,7 @@ async fn non_chat_headers( Ok(headers) } -/// Renders `queued_mail` for SMTP with the own key pair and primary address. +/// Renders `queued_mail` for SMTP with the own key pair and sending address. async fn render_with_self_key(context: &Context, queued_mail: QueuedMail) -> Result { let public_key = key::load_self_public_key(context).await?; let secret_key = key::load_self_secret_key(context).await?; diff --git a/src/smtp.rs b/src/smtp.rs index faf885384..14ad38610 100644 --- a/src/smtp.rs +++ b/src/smtp.rs @@ -730,9 +730,9 @@ pub(crate) async fn add_self_recipients( recipients: &mut Vec, encrypted: bool, ) -> Result<()> { - // Avoid sending unencrypted messages to all transports, chatmail relays won't accept - // them. Normally the user should have a non-chatmail primary transport to send unencrypted - // messages. + // Avoid sending unencrypted messages to all transports, + // chatmail relays won't accept them. Normally the user should have + // a non-chatmail sending transport to send unencrypted messages. let from = context.get_primary_self_addr().await?; if encrypted { for addr in context.get_self_addrs().await? { diff --git a/src/transport.rs b/src/transport.rs index c57c68d9a..9d07675c8 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -263,7 +263,7 @@ impl ConfiguredLoginParam { /// Load configured account settings from the database. /// /// Returns transport ID and configured parameters - /// of the current primary transport. + /// of the transport currently used for sending. /// Returns `None` if account is not configured. pub(crate) async fn load(context: &Context) -> Result> { let Some(self_addr) = context.get_config(Config::ConfiguredAddr).await? else { @@ -532,7 +532,7 @@ pub(crate) async fn save_transport( > 0; if configured_addr.is_none() { - // If there is no transport yet, set the new transport as the primary one + // If there is no transport yet, use the new transport for sending context .sql .set_raw_config(Config::ConfiguredAddr.as_ref(), Some(&addr)) @@ -676,7 +676,7 @@ pub(crate) async fn sync_transports( } if let Some(new_addr) = reelected { - info!(context, "Re-elected primary transport {new_addr:?}."); + info!(context, "Re-elected sending transport {new_addr:?}."); context.sql.uncache_raw_config("configured_addr").await; modified = true; }