From 2019debe9923239666f9556dc3a3c1bd37a286c0 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Tue, 27 Jan 2026 05:18:07 -0300 Subject: [PATCH] refactor: Rename lookup_key_contacts_by_address_list() to lookup_key_contacts_fallback_to_chat() It only looks up contacts by address in the given chat, so `_fallback_to_chat` suffix is more informative. It's obvious that such a lookup is done by address, there are no other reasonable options. --- src/receive_imf.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 8a58fd6de..b1e34ef01 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -282,7 +282,7 @@ async fn get_to_and_past_contact_ids( .await?; if let Some(chat_id) = chat_id { - past_ids = lookup_key_contacts_by_address_list( + past_ids = lookup_key_contacts_fallback_to_chat( context, &mime_parser.past_members, past_member_fingerprints, @@ -315,7 +315,7 @@ async fn get_to_and_past_contact_ids( Origin::Hidden, ) .await?; - past_ids = lookup_key_contacts_by_address_list( + past_ids = lookup_key_contacts_fallback_to_chat( context, &mime_parser.past_members, past_member_fingerprints, @@ -388,7 +388,7 @@ async fn get_to_and_past_contact_ids( } else { let ids = match mime_parser.was_encrypted() { true => { - lookup_key_contacts_by_address_list( + lookup_key_contacts_fallback_to_chat( context, &mime_parser.recipients, to_member_fingerprints, @@ -4185,7 +4185,7 @@ async fn lookup_key_contact_by_fingerprint( } } -/// Looks up key-contacts by email addresses. +/// Adds or looks up key-contacts by fingerprints or by email addresses in the given chat. /// /// `fingerprints` may be empty. /// This is used as a fallback when email addresses are available, @@ -4200,7 +4200,7 @@ async fn lookup_key_contact_by_fingerprint( /// is the same as the number of addresses in the header /// and it is possible to find corresponding /// `Chat-Group-Member-Timestamps` items. -async fn lookup_key_contacts_by_address_list( +async fn lookup_key_contacts_fallback_to_chat( context: &Context, address_list: &[SingleInfo], fingerprints: &[Fingerprint],