Changeset 19daa3


Ignore:
Timestamp:
Sep 18, 2008, 11:07:42 PM (13 years ago)
Author:
rene <rene@…>
Branches:
lite_0.1, multiEdit, ng_0.6, ng_0.6_help, ng_0.8, ng_0.9
Children:
c7ec22
Parents:
bf9fed
Message:

collection of changes to 0.6 branch

Location:
chrome/content/v_identity
Files:
3 edited

Legend:

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

    rbf9fed r19daa3  
    9898                if (    (this.ignoreFullNameWhileComparing || this.fullName == identities[j].fullName) &&
    9999                    (this.email == identities[j].email) &&
    100                     this.__equalSMTP(new smtpObj(identities[j].smtpServerKey))  ) {
     100                    this.smtp.equal(new smtpObj(identities[j].smtpServerKey))   ) {
    101101                    vI_notificationBar.dump("## vI_identityData: isExistingIdentity: " + this.combinedName + " found, id='" + identities[j].key + "'\n");
    102102                    return identities[j].key;
     
    107107        return null;
    108108    },
    109 
    110     __equalSMTP : function(compareSmtp) {
    111 //      vI_notificationBar.dump("## vI_identityData: compare: '" + this.smtp.key + "' with '" + compareSmtp.key + "'\n");
    112         var mainSmtpKey = this.smtp.key; var compareSmtpKey = compareSmtp.key;
    113         if (!this.smtp.key || !this.smtp.valid) mainSmtpKey = this.smtpService.defaultServer.key;
    114         if (!compareSmtp.key || !compareSmtp.valid) compareSmtpKey = this.smtpService.defaultServer.key;
    115         return (mainSmtpKey == compareSmtpKey);
    116     },
    117    
    118     __equalID : function(compareID) {
    119 //      vI_notificationBar.dump("## vI_identityData: compare: '" + this.id.key + "' with '" + compareID.key + "'\n");
    120         // if basic ID is not set (default) than answer equal
    121         if (!this.id.key) return true;
    122         return (this.id.key == compareID.key);
    123     },
    124 
     109   
    125110    __equalsIdentity : function(identity) {
    126111        var testIdentity = new identityData(
     
    138123        this.comp.equals.fullName = (this.ignoreFullNameWhileComparing || this.fullName == compareIdentityData.fullName)
    139124        this.comp.equals.email = (this.email == compareIdentityData.email)
    140         this.comp.equals.smtp = this.__equalSMTP(compareIdentityData.smtp);
    141         this.comp.equals.id = this.__equalID(compareIdentityData.id);
     125        this.comp.equals.smtp = this.smtp.equal(compareIdentityData.smtp);
     126        this.comp.equals.id = this.id.equal(compareIdentityData.id);
    142127        this.comp.equals.extras = this.extras.equal(compareIdentityData.extras);
    143128//      vI_notificationBar.dump("## vI_identityData: smtp:'" + this.comp.equals.smtp + "' id:'" + this.comp.equals.id + "'\n");
     
    243228    _key : null,
    244229    _value : null,
    245     _valid : null,
    246     get valueOf() { return this.key },
    247 
    248     set key(key) { this._key = key; this._value = null; this._valid = null; },
    249     get key() { return this._key },
     230   
     231    set key(key) { this._key = key; this._value = null; },
     232    get key() { if (this._value == null) var dummy = this.value; return this._key },
    250233    get value() {
    251         if (!this._value) {
     234        // if key == null, it is not known / if it is "" it's the Default SMTP
     235        if (this._value != null) {
    252236            this._value = "";
    253             if (this._key) {
     237            if (this._key == "") this._value = this.DEFAULT_TAG;
     238            else if (this._key != null) {
    254239                var smtpService = Components.classes["@mozilla.org/messengercompose/smtp;1"]
    255240                    .getService(Components.interfaces.nsISmtpService);
    256241                var server = smtpService.getServerByKey(this.key);
    257                 if (server) { this._value = server.description?server.description:server.hostname; this._valid = true }
     242                if (server) this._value = server.description?server.description:server.hostname
     243                else this._key = null;  // if non-existant SMTP handle like non available   
    258244            }
    259245        }
    260246        return this._value;
    261247    },
    262     get valid() { var dummy = this.value; return this._valid; }
     248    equal : function(compareSmtpObj) {
     249        if (this.key == null || compareSmtpObj.key == null) return true;
     250        return (this.key == compareSmtpObj.key);
     251    }
    263252}
    264253
     
    269258    _valid : null,
    270259
    271     get valueOf() { return this.key },
    272     set key(key) { this._key = key; this._value = null; this._valid = null; },
    273     get key() { return this._key },
     260    set key(key) { this._key = key; this._value = null; },
     261    get key() { if (this._value == null) var dummy = this.value; return this._key },
    274262    get value() {
    275         if (!this._value) {
     263        if (this._value != null) {
    276264            this._value = "";
    277265            if (this._key) {
     
    279267                    .getService(Components.interfaces.nsIMsgAccountManager);
    280268                var identity = accountManager.getIdentity(this._key);
    281                 if (identity) { this._value = identity.identityName; this._valid = true }
     269                if (identity) this._value = identity.identityName
     270                this._key = null;   // if non-existant ID handle like non available
    282271            }
    283272        }
    284273        return this._value;
    285274    },
    286     get valid() { var dummy = this.value; return this._valid; }
    287 }
     275    equal : function(compareIdObj) {
     276        if (!this.key || !compareIdObj.key) return true;
     277        return (this.key == compareIdObj.key);
     278    }
     279}
  • chrome/content/v_identity/vI_rdfDataTree.xul

    rbf9fed r19daa3  
    4444
    4545<script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDataTree.js" />
     46<script type="application/x-javascript" src="chrome://v_identity/content/vI_identityData.js" />
    4647<script type="application/x-javascript" src="chrome://v_identity/content/vI_helper.js" />
    4748<script type="application/x-javascript" src="chrome://v_identity/content/vI_rdfDatasource.js" />
  • chrome/content/v_identity/vI_rdfDatasource.js

    rbf9fed r19daa3  
    170170            var id = vI_rdfDatasource.__getRDFValue(resource, "id")
    171171            var smtp = vI_rdfDatasource.__getRDFValue(resource, "smtp")
     172            if (!smtp) smtp = ""; // to indicate default SMTP (different than null like with SmartReply)
     173           
    172174            var extras = new vI_storageExtras(vI_rdfDatasource.__getRDFValue, resource);
    173175           
     
    192194        var id = vI_rdfDatasource.__getRDFValue(resource, "id")
    193195        var smtp = vI_rdfDatasource.__getRDFValue(resource, "smtp")
     196        if (!smtp) smtp = ""; // to indicate default SMTP (different than null like with SmartReply)
    194197       
    195198        vI_notificationBar.dump("## vI_rdfDatasource: email='" + email +
Note: See TracChangeset for help on using the changeset viewer.