This is just some static backup of the original site, don't expect every link to work!

Changeset b466b2


Ignore:
Timestamp:
Jul 6, 2010, 4:46:05 PM (12 years ago)
Author:
rene <rene@…>
Branches:
ng_0.6, ng_0.8, ng_0.9
Children:
c1ef68
Parents:
461319
Message:

prefer full match instead of IgnoreFullName? while searching for existingIdentity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_identityData.js

    r461319 rb466b2  
    102102//      vI_notificationBar.dump("## vI_identityData base: fullName.toLowerCase()='" + this.fullName + "' email.toLowerCase()='" + this.email + "' smtp='" + this.smtp.key + "'\n");
    103103
     104        var ignoreFullNameMatchKey = null;
     105
    104106        var accounts = queryISupportsArray(gAccountManager.accounts, Components.interfaces.nsIMsgAccount);
    105107        for (var i in accounts) {
     
    112114                var email = this.email?this.email:"";               // might be null if no identity is set
    113115                var idEmail = identities[j].email?identities[j].email:"";   // might be null if no identity is set
    114                 if (    (ignoreFullNameWhileComparing ||
    115                     this.fullName.toLowerCase() == identities[j].fullName.toLowerCase()) &&
    116                     (email.toLowerCase() == idEmail.toLowerCase()) &&
     116                if (    (email.toLowerCase() == idEmail.toLowerCase()) &&
    117117                    this.smtp.equal(new vI_smtpObj(identities[j].smtpServerKey))    ) {
    118                     vI_notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " found, id='" + identities[j].key + "'\n");
    119                     return identities[j].key;
     118                        // if fullName matches, than this is a final match
     119                        if ( this.fullName.toLowerCase() == identities[j].fullName.toLowerCase() ) {
     120                            vI_notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " found, id='" + identities[j].key + "'\n");
     121                            return identities[j].key; // return key and stop searching
     122                        }
     123                        // if fullNames don't match, remember the key but continue to search for full match
     124                        else if (!ignoreFullNameMatchKey) ignoreFullNameMatchKey = identities[j].key;
    120125                }
    121126            }
    122127        }
     128
     129        if ( ignoreFullNameWhileComparing && ignoreFullNameMatchKey ) {
     130            vI_notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " found, id='" + ignoreFullNameMatchKey + "'\n");
     131            return  ignoreFullNameMatchKey;
     132        }
     133
    123134        vI_notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " not found\n");
    124135        return null;
Note: See TracChangeset for help on using the changeset viewer.