chore: cleanup "primary" wording in comments

This commit is contained in:
holger krekel
2026-09-15 13:44:38 +02:00
parent a8e1110bcd
commit 63364da79c
5 changed files with 15 additions and 15 deletions
+7 -7
View File
@@ -195,9 +195,9 @@ pub enum Config {
#[strum(props(default = "0"))] #[strum(props(default = "0"))]
DeleteDeviceAfter, 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, ConfiguredAddr,
/// Deprecated(2026-04). /// Deprecated(2026-04).
@@ -806,7 +806,7 @@ impl Context {
(time(), addr), (time(), addr),
) )
.context( .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. // Clean up SMTP queue.
@@ -819,7 +819,8 @@ impl Context {
Ok(()) Ok(())
}) })
.await?; .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; self.sql.uncache_raw_config("configured_addr").await;
send_sync_transports(self).await?; send_sync_transports(self).await?;
} }
@@ -917,8 +918,7 @@ impl Context {
.any(|a| addr_cmp(addr, a))) .any(|a| addr_cmp(addr, a)))
} }
/// Sets `primary_new` as the new primary self address and saves the old /// Sets `primary_new` as the address used for sending.
/// primary address (if exists) as a secondary address.
/// ///
/// This should only be used by test code and during configure. /// This should only be used by test code and during configure.
#[cfg(test)] // AEAP is disabled, but there are still tests for it #[cfg(test)] // AEAP is disabled, but there are still tests for it
@@ -940,7 +940,7 @@ impl Context {
.await .await
} }
/// Returns the primary self address. /// Returns the address of the transport used for sending.
/// Returns an error if no self addr is configured. /// Returns an error if no self addr is configured.
pub async fn get_primary_self_addr(&self) -> Result<String> { pub async fn get_primary_self_addr(&self) -> Result<String> {
self.get_config(Config::ConfiguredAddr) self.get_config(Config::ConfiguredAddr)
+1 -1
View File
@@ -433,7 +433,7 @@ pub enum EventType {
chat_id: ChatId, 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. /// UI should update the list.
/// ///
+1 -1
View File
@@ -2467,7 +2467,7 @@ async fn non_chat_headers(
Ok(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<String> { async fn render_with_self_key(context: &Context, queued_mail: QueuedMail) -> Result<String> {
let public_key = key::load_self_public_key(context).await?; let public_key = key::load_self_public_key(context).await?;
let secret_key = key::load_self_secret_key(context).await?; let secret_key = key::load_self_secret_key(context).await?;
+3 -3
View File
@@ -730,9 +730,9 @@ pub(crate) async fn add_self_recipients(
recipients: &mut Vec<String>, recipients: &mut Vec<String>,
encrypted: bool, encrypted: bool,
) -> Result<()> { ) -> Result<()> {
// Avoid sending unencrypted messages to all transports, chatmail relays won't accept // Avoid sending unencrypted messages to all transports,
// them. Normally the user should have a non-chatmail primary transport to send unencrypted // chatmail relays won't accept them. Normally the user should have
// messages. // a non-chatmail sending transport to send unencrypted messages.
let from = context.get_primary_self_addr().await?; let from = context.get_primary_self_addr().await?;
if encrypted { if encrypted {
for addr in context.get_self_addrs().await? { for addr in context.get_self_addrs().await? {
+3 -3
View File
@@ -263,7 +263,7 @@ impl ConfiguredLoginParam {
/// Load configured account settings from the database. /// Load configured account settings from the database.
/// ///
/// Returns transport ID and configured parameters /// 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. /// Returns `None` if account is not configured.
pub(crate) async fn load(context: &Context) -> Result<Option<(u32, Self)>> { pub(crate) async fn load(context: &Context) -> Result<Option<(u32, Self)>> {
let Some(self_addr) = context.get_config(Config::ConfiguredAddr).await? else { let Some(self_addr) = context.get_config(Config::ConfiguredAddr).await? else {
@@ -532,7 +532,7 @@ pub(crate) async fn save_transport(
> 0; > 0;
if configured_addr.is_none() { 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 context
.sql .sql
.set_raw_config(Config::ConfiguredAddr.as_ref(), Some(&addr)) .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 { 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; context.sql.uncache_raw_config("configured_addr").await;
modified = true; modified = true;
} }