Skip to content

Commit 28e198b

Browse files
committed
Remove deduplication from add_or_lookup_contacts_by_address_list
1 parent b8c2aa3 commit 28e198b

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/receive_imf.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,15 +2961,12 @@ pub(crate) async fn get_prefetch_parent_message(
29612961
}
29622962

29632963
/// Looks up contact IDs from the database given the list of recipients.
2964-
///
2965-
/// Returns vector of IDs guaranteed to be unique.
29662964
async fn add_or_lookup_contacts_by_address_list(
29672965
context: &Context,
29682966
address_list: &[SingleInfo],
29692967
origin: Origin,
29702968
) -> Result<Vec<ContactId>> {
29712969
let mut contact_ids = Vec::new();
2972-
let mut contact_ids_set = HashSet::new();
29732970
for info in address_list {
29742971
let addr = &info.addr;
29752972
if !may_be_valid_addr(addr) {
@@ -2980,10 +2977,7 @@ async fn add_or_lookup_contacts_by_address_list(
29802977
let (contact_id, _) =
29812978
Contact::add_or_lookup(context, display_name.unwrap_or_default(), &addr, origin)
29822979
.await?;
2983-
if !contact_ids_set.contains(&contact_id) {
2984-
contact_ids.push(contact_id);
2985-
contact_ids_set.insert(contact_id);
2986-
}
2980+
contact_ids.push(contact_id);
29872981
} else {
29882982
warn!(context, "Contact with address {:?} cannot exist.", addr);
29892983
}

0 commit comments

Comments
 (0)