mirror of
https://github.com/chatmail/core.git
synced 2026-10-02 03:00:40 +03:00
fix: recognize self addresses in various places (instead of just the "primary")
This commit is contained in:
@@ -152,6 +152,20 @@ async fn test_get_contacts() -> Result<()> {
|
||||
assert_eq!(contacts.len(), 1);
|
||||
let contacts = Contact::get_all(&context, 0, Some("δ")).await?;
|
||||
assert_eq!(contacts.len(), 1);
|
||||
|
||||
// Searching for a secondary self address finds "Me",
|
||||
// even if the transport is unpublished.
|
||||
crate::transport::add_pseudo_transport(&context, "bob@second.example").await?;
|
||||
context
|
||||
.set_transport_unpublished("bob@second.example", true)
|
||||
.await?;
|
||||
let contacts = Contact::get_all(
|
||||
&context,
|
||||
constants::DC_GCL_ADD_SELF,
|
||||
Some("bob@second.example"),
|
||||
)
|
||||
.await?;
|
||||
assert_eq!(contacts, vec![ContactId::SELF]);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user