Description
Quicktext can select the wrong contact when multiple contacts have similar email addresses.
For example, consider these two contacts:
- John Doe —
doe@example.com
- Jane Doe —
jane.doe@example.com
When composing a message to:
doe@example.com
browser.contacts.quickSearch() may return both contacts. The current code simply selects the first contact of type contact:
let card = cards.find(c => c.type == "contact");
Depending on the order returned by Thunderbird, Quicktext may therefore use the contact information of Jane Doe instead of John Doe.
The contact lookup should preferably select a contact whose email address exactly matches the recipient address.
If no exact match is available, falling back to the current behavior would preserve the existing behavior for cases where Thunderbird does not return an exact email match.
Description
Quicktext can select the wrong contact when multiple contacts have similar email addresses.
For example, consider these two contacts:
doe@example.comjane.doe@example.comWhen composing a message to:
doe@example.combrowser.contacts.quickSearch()may return both contacts. The current code simply selects the first contact of typecontact:Depending on the order returned by Thunderbird, Quicktext may therefore use the contact information of Jane Doe instead of John Doe.
The contact lookup should preferably select a contact whose email address exactly matches the recipient address.
If no exact match is available, falling back to the current behavior would preserve the existing behavior for cases where Thunderbird does not return an exact email match.