Changeset 88d969f


Ignore:
Timestamp:
Mar 6, 2010, 3:25:35 PM (10 years ago)
Author:
rene <rene@…>
Branches:
multiEdit, ng_0.6, ng_0.8, ng_0.9
Children:
86631f
Parents:
9fe49e
Message:

tagged pre-existing identity to handle empty identities

Location:
chrome/content/v_identity
Files:
2 edited

Legend:

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

    r9fe49e r88d969f  
    2323 * ***** END LICENSE BLOCK ***** */
    2424
    25 function identityData(email, fullName, id, smtp, extras, sideDescription) {
     25function identityData(email, fullName, id, smtp, extras, sideDescription, existingID) {
    2626    this.email = email;
    2727    this.fullName = (fullName?fullName:'');
     
    3434    }
    3535    if (sideDescription) this.sideDescription = sideDescription;
     36    if (existingID) this.existingID = existingID;
    3637    else if (this.id.value) this.sideDescription = " - " + this.id.value;
    3738    this.stringBundle = document.getElementById("vIdentBundle");
     
    4445    extras : null,
    4546    sideDescription : null,
     47    existingID : null,      // indicates that this is a pre-defined Identity, which might handled slightly differently
    4648   
    4749    stringBundle : null,
     
    8284    // creates an Duplicate of the current IdentityData, cause usually we are working with a pointer
    8385    getDuplicate : function() {
    84         return new identityData(this.email, this.fullName, this.id.key, this.smtp.key, this.extras.getDuplicate(), this.sideDescription);
     86        return new identityData(this.email, this.fullName, this.id.key, this.smtp.key, this.extras.getDuplicate(), this.sideDescription, this.existingID);
    8587    },
    8688
     
    108110            for (var j in identities) {
    109111//              vI_notificationBar.dump("## vI_identityData comp: fullName.toLowerCase()='" + identities[j].fullName.toLowerCase() + "' email.toLowerCase()='" + identities[j].email.toLowerCase() + "' smtp='" + identities[j].smtpServerKey + "'\n");
    110 
     112                var email = this.email?this.email:"";               // might be null if no identity is set
     113                var idEmail = identities[j].email?identities[j].email:"";   // might be null if no identity is set
    111114                if (    (ignoreFullNameWhileComparing ||
    112115                    this.fullName.toLowerCase() == identities[j].fullName.toLowerCase()) &&
    113                     (this.email.toLowerCase() == identities[j].email.toLowerCase()) &&
     116                    (email.toLowerCase() == idEmail.toLowerCase()) &&
    114117                    this.smtp.equal(new smtpObj(identities[j].smtpServerKey))   ) {
    115118                    vI_notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " found, id='" + identities[j].key + "'\n");
  • chrome/content/v_identity/v_identity.xml

    r9fe49e r88d969f  
    369369           
    370370            var newIdentity = new identityData(identity.email, identity.fullName, identity.key,
    371                         identity.smtpServerKey, null, description)
     371                        identity.smtpServerKey, null, description, true)
    372372            newIdentity.extras.readIdentityValues(identity);
    373 
     373               
    374374            var menuItem = this.addIdentityToCloneMenu(newIdentity)
    375375
     
    538538            this._identityDataStorage = val;
    539539            if (oldIdentityData) { // indicates that it's not first time after clean
    540                 vI_notificationBar.dump("** v_identity.xml previousID: fullName='" + oldIdentityData.fullName + "' email='" + oldIdentityData.email + "' smtp='" + oldIdentityData.smtp.key + "' id='" + oldIdentityData.id.key + "'\n");
    541                 vI_notificationBar.dump("** v_identity.xml newID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "'\n");
    542                 if (!this._identityDataStorage.combinedName) this._identityDataStorage.fullName = oldIdentityData.fullName;
    543                 if (!this._identityDataStorage.email) this._identityDataStorage.email = oldIdentityData.email;
     540                vI_notificationBar.dump("** v_identity.xml previousID: fullName='" + oldIdentityData.fullName + "' email='" + oldIdentityData.email + "' smtp='" + oldIdentityData.smtp.key + "' id='" + oldIdentityData.id.key + "' existingID='" + oldIdentityData.existingID + "'\n");
     541                vI_notificationBar.dump("** v_identity.xml newID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "' existingID='" + this._identityDataStorage.existingID + "'\n");
     542                if (!this._identityDataStorage.existingID && !this._identityDataStorage.combinedName)
     543                    this._identityDataStorage.fullName = oldIdentityData.fullName;
     544                if (!this._identityDataStorage.existingID && !this._identityDataStorage.email)
     545                    this._identityDataStorage.email = oldIdentityData.email;
    544546                if (!this._identityDataStorage.smtp.key) this._identityDataStorage.smtp.key = oldIdentityData.smtp.key;
    545547                if (!this._identityDataStorage.id.key) this._identityDataStorage.id.key = oldIdentityData.id.key;
    546548                this._identityDataStorage.extras.setValues();
    547                 this.checkForVirtualIdentity();
     549                if (this._identityDataStorage.existingID) this.vid = false;
     550                else this.checkForVirtualIdentity();
    548551            }
    549552            else    this.vid = false;       // first time after clean it's always a real identity
     
    553556            this.description = this._identityDataStorage.sideDescription;
    554557            document.getAnonymousElementByAttribute(this, "anonid", "smtpServerListHbox").smtp = this._identityDataStorage.smtp.keyNice;
    555             vI_notificationBar.dump("** v_identity.xml resultingID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "'\n");         
     558            vI_notificationBar.dump("** v_identity.xml resultingID: fullName='" + this._identityDataStorage.fullName + "' email='" + this._identityDataStorage.email + "' smtp='" + this._identityDataStorage.smtp.key + "' id='" + this._identityDataStorage.id.key + "' existingID='" + this._identityDataStorage.existingID + "'\n");           
    556559        }
    557560        vI_notificationBar.dump("** v_identity.xml identityData setter done.'\n")
Note: See TracChangeset for help on using the changeset viewer.