fix: let search also return hidden contacts if search value is an email address

This commit is contained in:
holger krekel
2026-04-07 21:33:43 +02:00
parent f552cf93b4
commit 60bc4011f7
3 changed files with 15 additions and 13 deletions

View File

@@ -57,9 +57,9 @@ async fn test_key_contacts_migration_autocrypt() -> Result<()> {
);
assert_eq!(pgp_bob.get_verifier_id(&t).await?, None);
// Hidden address-contact can't be looked up.
// Hidden address-contact can't be looked up by name.
assert!(
Contact::get_all(&t, constants::DC_GCL_ADDRESS, Some("bob@example.net"))
Contact::get_all(&t, constants::DC_GCL_ADDRESS, Some("bob"))
.await?
.is_empty()
);
@@ -113,12 +113,8 @@ async fn test_key_contacts_migration_email2() -> Result<()> {
)?)).await?;
t.sql.run_migrations(&t).await?;
// Hidden key-contact can't be looked up.
assert!(
Contact::get_all(&t, 0, Some("bob@example.net"))
.await?
.is_empty()
);
// Hidden key-contact can't be looked up by name.
assert!(Contact::get_all(&t, 0, Some("bob")).await?.is_empty());
let pgp_bob = Contact::get_by_id(&t, ContactId::new(11001)).await?;
assert_eq!(pgp_bob.is_key_contact(), true);
assert_eq!(pgp_bob.origin, Origin::Hidden);
@@ -156,9 +152,9 @@ async fn test_key_contacts_migration_verified() -> Result<()> {
t.sql.run_migrations(&t).await?;
// Hidden address-contact can't be looked up.
// Hidden address-contact can't be looked up by name.
assert!(
Contact::get_all(&t, constants::DC_GCL_ADDRESS, Some("bob@example.net"))
Contact::get_all(&t, constants::DC_GCL_ADDRESS, Some("bob"))
.await?
.is_empty()
);