Changeset 994fa9


Ignore:
Timestamp:
Sep 10, 2018, 1:43:05 PM (3 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
cadf2f
Parents:
2d2cb7
Message:

added smtp-Label and Account Description

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/vI_identityData.js

    r2d2cb7 r994fa9  
    138138    return this.__makeHtml(this.id.value);
    139139  },
     140  get smtpHtml() {
     141    return this.__makeHtml(this.id.smtpServerName);
     142  },
    140143  get fullNameHtml() {
    141144    return this.__makeHtml(this.fullName);
     
    150153  get idLabel() {
    151154    return this.stringBundle.GetStringFromName("vident.identityData.baseID")
     155  },
     156  get smtpLabel() {
     157    return this.stringBundle.GetStringFromName("vident.identityData.SMTP")
    152158  },
    153159  get fullNameLabel() {
     
    189195  // dependent on MsgComposeCommands, should/will only be called in ComposeDialog
    190196  isExistingIdentity: function (ignoreFullNameWhileComparing) {
    191     Log.debug("isExistingIdentity: ignoreFullNameWhileComparing='" + ignoreFullNameWhileComparing + "'");
     197    var intenseDebug = false;
     198    if (intenseDebug)
     199      Log.debug("isExistingIdentity: ignoreFullNameWhileComparing='" + ignoreFullNameWhileComparing + "'");
    192200    //      Log.debug("base: fullName.toLowerCase()='" + this.fullName + "' email.toLowerCase()='" + this.email + "'");
    193201
     
    209217          // if fullName matches, than this is a final match
    210218          if (this.fullName.toLowerCase() == identity.fullName.toLowerCase()) {
    211             Log.debug("isExistingIdentity: " + this.combinedName + " found, id='" + identity.key + "'");
     219            if (intenseDebug)
     220              Log.debug("isExistingIdentity: " + this.combinedName + " found, id='" + identity.key + "'");
    212221            return identity.key; // return key and stop searching
    213222          }
     
    219228
    220229    if (ignoreFullNameWhileComparing && ignoreFullNameMatchKey) {
    221       Log.debug("isExistingIdentity: " + this.combinedName + " found, id='" + ignoreFullNameMatchKey + "'");
     230      if (intenseDebug)
     231        Log.debug("isExistingIdentity: " + this.combinedName + " found, id='" + ignoreFullNameMatchKey + "' (without FullName match)");
    222232      return ignoreFullNameMatchKey;
    223233    }
    224234
    225     Log.debug("isExistingIdentity: " + this.combinedName + " not found");
     235    if (intenseDebug)
     236      Log.debug("isExistingIdentity: " + this.combinedName + " not found");
    226237    return null;
    227238  },
     
    266277      return false;
    267278   
     279    var intenseDebug = false;
     280    if (intenseDebug) Log.debug("compareIdentityData");
     281   
    268282    this.comp.compareID = compareIdentityData;
    269283
    270284    this.comp.equals.fullName = (((this.fullName) ? this.fullName.toLowerCase() : null) == ((compareIdentityData.fullName) ? compareIdentityData.fullName.toLowerCase() : null));
    271     if (!this.comp.equals.fullName) {
    272       //       Log.debug("fullName not equal ('" + ((this.fullName)?this.fullName.toLowerCase():null) + "' != '" + ((compareIdentityData.fullName)?compareIdentityData.fullName.toLowerCase():null) + "')");
     285    if (intenseDebug && !this.comp.equals.fullName) {
     286            Log.debug("fullName not equal ('" + ((this.fullName)?this.fullName.toLowerCase():null) + "' != '" + ((compareIdentityData.fullName)?compareIdentityData.fullName.toLowerCase():null) + "')");
    273287    }
    274288    this.comp.equals.email = (((this.email) ? this.email.toLowerCase() : null) == ((compareIdentityData.email) ? compareIdentityData.email.toLowerCase() : null));
    275     if (!this.comp.equals.email) {
    276       //       Log.debug("email not equal ('" + ((this.email)?this.email.toLowerCase():null) + "' != '" + ((compareIdentityData.email)?compareIdentityData.email.toLowerCase():null) + "')");
     289    if (intenseDebug && !this.comp.equals.email) {
     290            Log.debug("email not equal ('" + ((this.email)?this.email.toLowerCase():null) + "' != '" + ((compareIdentityData.email)?compareIdentityData.email.toLowerCase():null) + "')");
    277291    }
    278292
    279293    this.comp.equals.id = this.id.equal(compareIdentityData.id);
     294    if (intenseDebug && !this.comp.equals.id) {
     295            Log.debug("id not equal ('" + this.id + "' != '" + compareIdentityData.id + "')");
     296    }
     297
    280298    this.comp.equals.extras = this.extras ? this.extras.equal(compareIdentityData.extras) : true;
     299    if (intenseDebug && !this.comp.equals.extras) {
     300            Log.debug("extras not equal");
     301    }
    281302
    282303    return (this.comp.equals.fullName && this.comp.equals.email && this.comp.equals.id && this.comp.equals.extras);
     
    313334  getMatrix: function () {
    314335    var string = "";
    315     if (this["idHtml"])
     336    if (this["idHtml"]) {
    316337        string = "<tr><td class='col1'>" + this["idLabel"] + ":</td>" +
    317         "<td class='col2'>" + this["idHtml"] + "</td></tr>"
     338        "<td class='col2'>" + this["idHtml"] + "</td></tr>" +
     339        "<tr><td class='col1'>" + this["smtpLabel"] + ":</td>" +
     340        "<td class='col2'>" + this["smtpHtml"] + "</td></tr>";
     341    }
    318342    string += this.extras ? this.extras.getMatrix() : "";
    319343    return string;
     
    385409  _value: null,
    386410  _accountkey: null,
     411  _accountIncomingServerPrettyName: null,
     412  _accountManager: Components.classes["@mozilla.org/messenger/account-manager;1"]
     413    .getService(Components.interfaces.nsIMsgAccountManager),
    387414
    388415  set key(key) {
     
    398425    return this._accountkey
    399426  },
     427 
     428  get accountIncomingServerPrettyName() {
     429    if (this._value == null) var dummy = this.value;
     430    return this._accountIncomingServerPrettyName
     431  },
     432 
    400433  get value() {
    401434    if (this._value == null) {
     
    413446            this._value = identity.identityName;
    414447            this._accountkey = account.key;
     448            this._accountIncomingServerPrettyName = account.incomingServer.prettyName;
    415449            break;
    416450          }
     
    428462    if (!this.key)
    429463      return null;
    430     var AccountManager = Components.classes["@mozilla.org/messenger/account-manager;1"]
    431           .getService(Components.interfaces.nsIMsgAccountManager);
    432 
    433     var identity = AccountManager.getIdentity(this.key);
     464
     465    var identity = this._accountManager.getIdentity(this.key);
    434466    if (identity) {
    435467      if (identity.smtpServerKey)
Note: See TracChangeset for help on using the changeset viewer.