chore: cleanup "primary" wording in comments

This commit is contained in:
holger krekel
2026-09-14 08:31:19 +02:00
parent a8e1110bcd
commit 63364da79c
5 changed files with 15 additions and 15 deletions

View File

@@ -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<String> {
self.get_config(Config::ConfiguredAddr)

View File

@@ -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.
///

View File

@@ -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<String> {
let public_key = key::load_self_public_key(context).await?;
let secret_key = key::load_self_secret_key(context).await?;

View File

@@ -730,9 +730,9 @@ pub(crate) async fn add_self_recipients(
recipients: &mut Vec<String>,
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? {

View File

@@ -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<Option<(u32, Self)>> {
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;
}