Changeset 92b812


Ignore:
Timestamp:
Apr 19, 2008, 2:54:53 PM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
4dfe1d
Parents:
9803e3
Message:

keytranslator modified to recognize non-existent smtp and id keys
modified parseAddress to remove '"' from names

File:
1 edited

Legend:

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

    r9803e3 r92b812  
    55    SMTP_NAMES : null,
    66    ID_NAMES : null,
     7    DEFAULT_TAG : null,
     8   
    79    __getSMTPnames : function () {
    810        this.SMTP_NAMES = [];
     
    1416                this.SMTP_NAMES[server.key] = server.description?server.description:server.hostname
    1517        }
     18        if (!this.DEFAULT_TAG) this.DEFAULT_TAG = document.getElementById("bundle_messenger").getString("defaultServerTag");
    1619    },
    1720    __getIDnames : function () {
     
    2629                this.ID_NAMES[identites[j].key] = identites[j].identityName;
    2730        }
     31        if (!this.DEFAULT_TAG) this.DEFAULT_TAG = document.getElementById("bundle_messenger").getString("defaultServerTag");
     32    },
     33    getSMTP : function (smtpKey) {
     34        if (!this.SMTP_NAMES) this.__getSMTPnames();
     35        return this.SMTP_NAMES[smtpKey];
     36    },
     37    getID : function (idKey) {
     38        if (!this.ID_NAMES) this.__getIDnames();
     39        return this.ID_NAMES[idKey];
    2840    },
    2941    getSMTPname : function (smtpKey) {
    30         if (!smtpKey) return document.getElementById("bundle_messenger").getString("defaultServerTag")
    31         else {
    32             if (!this.SMTP_NAMES) this.__getSMTPnames();
    33             return this.SMTP_NAMES[smtpKey]
    34         }
     42        if (!this.SMTP_NAMES) this.__getSMTPnames();
     43        return this.SMTP_NAMES[smtpKey]?this.SMTP_NAMES[smtpKey]:(smtpKey?this.DEFAULT_TAG+" "+smtpKey+" not found":this.DEFAULT_TAG)
    3544    },
    3645    getIDname : function (idKey) {
    37         if (!idKey) return "";
    3846        if (!this.ID_NAMES) this.__getIDnames();
    39         return this.ID_NAMES[idKey]
     47        return this.ID_NAMES[idKey]?this.ID_NAMES[idKey]:(idKey?this.DEFAULT_TAG+" "+idKey+" not found":this.DEFAULT_TAG)
    4048    },
    4149}
     
    93101            email = email.replace(/\s+|<|>/g,"")
    94102            name = name.replace(/^\s+|\s+$/g,"")
     103            name = name.replace(/^\"|\"$/g,"")
    95104        }
    96105        vI_notificationBar.dump("## v_identity: getAddress: address '" + address + "' name '" +
Note: See TracChangeset for help on using the changeset viewer.