fix 253109, for seamonkey, make identity smart logic case insensitive, patch by ch.ey@gmx.net, r=mscott, sr=me

This commit is contained in:
bienvenu%nventure.com 2005-02-02 17:47:25 +00:00
parent 2e3c2570c4
commit 4581a102b0

View File

@ -99,11 +99,13 @@ function getBestIdentity(identities, optionalHint)
{
// if we have more than one identity and a hint to help us pick one
if (identities.Count() > 1 && optionalHint) {
// normalize case on the optional hint to improve our chances of finding a match
optionalHint = optionalHint.toLowerCase();
// iterate over all of the identities
var tempID;
for (id = 0; id < identities.Count(); id++) {
tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity);
if (optionalHint.search(tempID.email) >= 0) {
if (optionalHint.search(tempID.email.toLowerCase()) >= 0) {
identity = tempID;
break;
}
@ -124,7 +126,7 @@ function getBestIdentity(identities, optionalHint)
// extract out the partial domain
var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives
if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) {
if (optionalHint.search(tempID.email.slice(start, tempID.email.length).toLowerCase()) >= 0) {
identity = tempID;
break;
}