Changeset 994fa9
- Timestamp:
- Sep 10, 2018, 1:43:05 PM (2 years ago)
- Branches:
- ng_0.9
- Children:
- cadf2f
- Parents:
- 2d2cb7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/vI_identityData.js
r2d2cb7 r994fa9 138 138 return this.__makeHtml(this.id.value); 139 139 }, 140 get smtpHtml() { 141 return this.__makeHtml(this.id.smtpServerName); 142 }, 140 143 get fullNameHtml() { 141 144 return this.__makeHtml(this.fullName); … … 150 153 get idLabel() { 151 154 return this.stringBundle.GetStringFromName("vident.identityData.baseID") 155 }, 156 get smtpLabel() { 157 return this.stringBundle.GetStringFromName("vident.identityData.SMTP") 152 158 }, 153 159 get fullNameLabel() { … … 189 195 // dependent on MsgComposeCommands, should/will only be called in ComposeDialog 190 196 isExistingIdentity: function (ignoreFullNameWhileComparing) { 191 Log.debug("isExistingIdentity: ignoreFullNameWhileComparing='" + ignoreFullNameWhileComparing + "'"); 197 var intenseDebug = false; 198 if (intenseDebug) 199 Log.debug("isExistingIdentity: ignoreFullNameWhileComparing='" + ignoreFullNameWhileComparing + "'"); 192 200 // Log.debug("base: fullName.toLowerCase()='" + this.fullName + "' email.toLowerCase()='" + this.email + "'"); 193 201 … … 209 217 // if fullName matches, than this is a final match 210 218 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 + "'"); 212 221 return identity.key; // return key and stop searching 213 222 } … … 219 228 220 229 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)"); 222 232 return ignoreFullNameMatchKey; 223 233 } 224 234 225 Log.debug("isExistingIdentity: " + this.combinedName + " not found"); 235 if (intenseDebug) 236 Log.debug("isExistingIdentity: " + this.combinedName + " not found"); 226 237 return null; 227 238 }, … … 266 277 return false; 267 278 279 var intenseDebug = false; 280 if (intenseDebug) Log.debug("compareIdentityData"); 281 268 282 this.comp.compareID = compareIdentityData; 269 283 270 284 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) + "')"); 273 287 } 274 288 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) + "')"); 277 291 } 278 292 279 293 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 280 298 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 } 281 302 282 303 return (this.comp.equals.fullName && this.comp.equals.email && this.comp.equals.id && this.comp.equals.extras); … … 313 334 getMatrix: function () { 314 335 var string = ""; 315 if (this["idHtml"]) 336 if (this["idHtml"]) { 316 337 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 } 318 342 string += this.extras ? this.extras.getMatrix() : ""; 319 343 return string; … … 385 409 _value: null, 386 410 _accountkey: null, 411 _accountIncomingServerPrettyName: null, 412 _accountManager: Components.classes["@mozilla.org/messenger/account-manager;1"] 413 .getService(Components.interfaces.nsIMsgAccountManager), 387 414 388 415 set key(key) { … … 398 425 return this._accountkey 399 426 }, 427 428 get accountIncomingServerPrettyName() { 429 if (this._value == null) var dummy = this.value; 430 return this._accountIncomingServerPrettyName 431 }, 432 400 433 get value() { 401 434 if (this._value == null) { … … 413 446 this._value = identity.identityName; 414 447 this._accountkey = account.key; 448 this._accountIncomingServerPrettyName = account.incomingServer.prettyName; 415 449 break; 416 450 } … … 428 462 if (!this.key) 429 463 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); 434 466 if (identity) { 435 467 if (identity.smtpServerKey)
Note: See TracChangeset
for help on using the changeset viewer.