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

Ignore:
Timestamp:
Oct 2, 2009, 1:20:09 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:
77bb12
Parents:
bdfae4
Message:

implementation of SMTP storage / change of interface

File:
1 edited

Legend:

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

    rbdfae4 rd1f668  
    228228};
    229229
     230const DEFAULT_SMTP_TAG = "vI_useDefaultSMTP"
     231const NO_SMTP_TAG = "vI_noStoredSMTP"
     232
    230233function smtpObj(key) {
    231234    this._key = key;
     
    238241   
    239242    set key(key) { this._key = key; this._value = null; },
    240     get key() { if (this._value == null) var dummy = this.value; return this._key },
     243    get key() {
     244        var dummy = this.value; // just to be sure key is adapted if SMTP is not available
     245        return this._key
     246    },
     247    get keyNice() { // the same as key but with "" for DEFAULT_SMTP_TAG
     248        if (this.key == DEFAULT_SMTP_TAG) return ""; // this is the key used for default server
     249        return this.key
     250    },
    241251    get value() {
    242252        if (this._value == null) {
    243253            this._value = "";
    244             // if key == null, it is not known / if it is "" it's the Default SMTP
    245             if (this._key == "") this._value = this.DEFAULT_TAG;
     254            if (this._key == null || this._key == "") this._key = DEFAULT_SMTP_TAG;
     255            if (this._key == DEFAULT_SMTP_TAG) this._value = this.DEFAULT_TAG;
     256            else if (!this._key) this._value = null;
    246257            else if (this._key) {
    247258                var servers = Components.classes["@mozilla.org/messengercompose/smtp;1"]
     
    265276                        }
    266277                    }
    267                 if (!this._value) this._key = null; // if non-existant SMTP handle like non available
     278                if (!this._value) this._key = NO_SMTP_TAG; // if non-existant SMTP handle like non available
    268279            }
    269280        }
     
    273284        if (this.key == null || compareSmtpObj.key == null) return true;
    274285        return (this.key == compareSmtpObj.key);
     286    },
     287    hasNoDefinedSMTP : function() {
     288        return (this.key == NO_SMTP_TAG);
    275289    }
    276290}
Note: See TracChangeset for help on using the changeset viewer.