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

Ignore:
Timestamp:
Sep 9, 2018, 2:36:02 AM (4 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
c5860f
Parents:
bc6c6b
Message:

removed everything related to smtp-storage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • content/bindings/vI_rdfAccountMismatchDialog.xml

    rbc6c6b r85fa10  
    7474    <implementation>
    7575    <constructor>
    76         <![CDATA[       
     76        <![CDATA[
    7777        var menuitem = document.createElement("menuitem");
    7878        menuitem.setAttribute("class", "mismatchMenuitem");
     
    9595        if (oldval) {
    9696        oldval.removeAttribute('selected');
    97         if (document instanceof Components.interfaces.nsIDOMXULDocument) {
     97        if (ChromeUtils.getClassName(document) == "XULDocument") {
    9898            document.removeBroadcastListenerFor(oldval, this, "value");
    9999            document.removeBroadcastListenerFor(oldval, this, "label");
     
    116116        // DOMAttrModified listeners slow down setAttribute calls within
    117117        // the document, see bug 395496
    118         if (document instanceof Components.interfaces.nsIDOMXULDocument) {
     118        if (ChromeUtils.getClassName(document) == "XULDocument") {
    119119            document.addBroadcastListenerFor(val, this, "value");
    120120            document.addBroadcastListenerFor(val, this, "label");
     
    156156        <body><![CDATA[
    157157        virtualIdentityExtension.Log.debug("rdfAccountMismatchDialog.xml mismatchID-menupopup: _addIdentities.");
     158        Components.utils.import("resource://v_identity/vI_accountUtils.js", virtualIdentityExtension);
    158159        var accounts = virtualIdentityExtension.getAccountsArray();
    159160        for (let acc = 0; acc < accounts.length; acc++) {
     
    174175        ]]></body>
    175176    </method>
    176     <method name="_addSmtp">
    177         <parameter name="server" />
     177    <method name="_addIdentitiesWithSmtp">
    178178        <body><![CDATA[
    179             virtualIdentityExtension.Log.debug("rdfAccountMismatchDialog.xml mismatchID-menupopup: _addSmtp.");
    180             const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    181             var menuitem = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
    182             menuitem.setAttribute("class", "mismatchMenuitem");
    183             menuitem.setAttribute("label",  (server.description?server.description:server.hostname));
    184             menuitem.setAttribute("ext1",  server.hostname);
    185             menuitem.setAttribute("ext2",  server.username);
    186             menuitem.setAttribute("key",  server.key);
    187             this.appendChild(menuitem);
     179        virtualIdentityExtension.Log.debug("rdfAccountMismatchDialog.xml mismatchID-menupopup: _addIdentitiesWithSmtp.");
     180        Components.utils.import("resource://v_identity/vI_accountUtils.js", virtualIdentityExtension);
     181        var accounts = virtualIdentityExtension.getAccountsArray();
     182        for (let acc = 0; acc < accounts.length; acc++) {
     183            let account = accounts[acc];
     184            let identities = virtualIdentityExtension.getIdentitiesArray(account);
     185            for (let i = 0; i < identities.length; i++) {
     186                let identity = identities[i];
     187                const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
     188                var menuitem = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
     189                menuitem.setAttribute("class", "mismatchMenuitem");
     190                menuitem.setAttribute("label",  identity.identityName);
     191               
     192                ChromeUtils.import("resource:///modules/mailServices.js");
     193                var servers = MailServices.smtp.servers;
     194
     195                var smtpName;
     196                while (servers && servers.hasMoreElements()) {
     197                  var server = servers.getNext();
     198                  if (server instanceof Components.interfaces.nsISmtpServer &&
     199                    !server.redirectorType && identity.smtpServerKey == server.key) {
     200                    smtpName = server.description ? server.description : server.hostname;
     201                    break;
     202                  }
     203                }
     204
     205                menuitem.setAttribute("ext1",  smtpName);
     206                menuitem.setAttribute("key",  identity.key);
     207                this.appendChild(menuitem);
     208            }
     209        }
     210        virtualIdentityExtension.Log.debug("rdfAccountMismatchDialog.xml mismatchID-menupopup: _addIdentitiesWithSmtp done.");
    188211        ]]></body>
    189     </method>
    190     <method name="_addSmtpServers">
    191         <body><![CDATA[
    192             virtualIdentityExtension.Log.debug("rdfAccountMismatchDialog.xml mismatchID-menupopup: _addSmtpServers.");
    193            
    194             const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    195             var menuitem = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
    196             menuitem.setAttribute("class", "mismatchMenuitem");
    197             menuitem.setAttribute("key", virtualIdentityExtension.identityData.DEFAULT_SMTP_TAG);
    198            
    199             menuitem.setAttribute("label", Components.classes["@mozilla.org/intl/stringbundle;1"]
    200               .getService(Components.interfaces.nsIStringBundleService)
    201               .createBundle("chrome://v_identity/locale/v_identity.properties")
    202               .GetStringFromName("defaultServerTag"));
    203        
    204             this.appendChild(menuitem);
    205            
    206             var servers, smtpService = Components.classes["@mozilla.org/messengercompose/smtp;1"]
    207                 .getService(Components.interfaces.nsISmtpService);
    208             // check for new https://hg.mozilla.org/comm-central/rev/fab9e5145cd4 smtpService
    209             if (typeof(smtpService.servers) == "object") servers = smtpService.servers;
    210             else servers = smtpService.smtpServers;
    211 
    212             while (servers && servers.hasMoreElements()) {
    213                 var server = servers.getNext();
    214                 if (server instanceof Components.interfaces.nsISmtpServer && !server.redirectorType) this._addSmtp(server);
    215             }
    216         ]]></body>
    217212    </method>
    218213    <constructor>
     
    221216        const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
    222217        this.appendChild(document.createElementNS(XUL_NS, "menuseparator")); // create a new XUL menuseparator
    223         if (this.getAttribute("type") == "identity") this._addIdentities();
    224         else    this._addSmtpServers();
    225         ]]>
     218        switch (this.getAttribute("type")) {
     219          case "identity":
     220            this._addIdentities();
     221            break;
     222          case "smtpid":
     223            this._addIdentitiesWithSmtp();
     224            break;
     225        }
     226        ]]>
    226227    </constructor>
    227228    </implementation>
Note: See TracChangeset for help on using the changeset viewer.