Bug 1045753 - Compose email LDAP erases text (autocompletes to blank entry when email not set). r=standard8

This commit is contained in:
Magnus Melin 2014-10-26 13:57:24 +02:00
Родитель 7544d36528
Коммит ab49575f4e
3 изменённых файлов: 20 добавлений и 14 удалений

Просмотреть файл

@ -241,13 +241,15 @@ nsAbAutoCompleteSearch.prototype = {
* it is the case. For mailing lists set it to true.
* @param result The result to add the new entry to.
*/
_addToResult: function _addToResult(commentColumn, directory, card,
emailToUse, isPrimaryEmail, result) {
var emailAddress =
this._parser.makeMailboxObject(card.displayName,
card.isMailList ?
card.getProperty("Notes", "") || card.displayName :
emailToUse).toString();
_addToResult: function(commentColumn, directory, card,
emailToUse, isPrimaryEmail, result) {
let mbox = this._parser.makeMailboxObject(card.displayName,
card.isMailList ? card.getProperty("Notes", "") || card.displayName :
emailToUse);
if (!mbox.email)
return;
let emailAddress = mbox.toString();
// If it is a duplicate, then just return and don't add it. The
// _checkDuplicate function deals with it all for us.

Просмотреть файл

@ -117,12 +117,14 @@ nsAbLDAPAutoCompleteSearch.prototype = {
});
},
_addToResult: function _addToResult(card) {
let emailAddress =
this._parser.makeMailboxObject(card.displayName,
card.isMailList ?
card.getProperty("Notes", "") || card.displayName :
card.primaryEmail).toString();
_addToResult: function(card) {
let mbox = this._parser.makeMailboxObject(card.displayName,
card.isMailList ? card.getProperty("Notes", "") || card.displayName :
card.primaryEmail);
if (!mbox.email)
return;
let emailAddress = mbox.toString();
// If it is a duplicate, then just return and don't add it. The
// _checkDuplicate function deals with it all for us.

Просмотреть файл

@ -32,7 +32,9 @@ const cards = [
{ email: "g@test.invalid", secondEmail: "f@test.invalid",
displayName: "3testsort", popularityIndex: 3 },
{ email: "j@test.invalid", secondEmail: "h@test.invalid",
displayName: "3testsort", popularityIndex: 5 }
displayName: "3testsort", popularityIndex: 5 },
// Add a contact that matches, but has no email. Should not show up.
{ displayName: "primaryX" }
];
// These are for the initial search