Browse Source

Some more patches for cZ

Ian Neal 1 week ago
parent
commit
24578a35d0

+ 83 - 0
comm-release/patches/1924586-irc-remove-getWindowByType-25320.patch

@@ -0,0 +1,83 @@
+# HG changeset patch
+# User Ian Neal <iann_cvs@blueyonder.co.uk>
+# Date 1728940744 -3600
+# Parent  09661a8f7880eed382cc82fe98537c3e56f4ee05
+Bug 1924586 - Remove getWindowByType function from cZ. r=frg a=frg
+
+diff --git a/suite/extensions/irc/js/lib/utils.js b/suite/extensions/irc/js/lib/utils.js
+--- a/suite/extensions/irc/js/lib/utils.js
++++ b/suite/extensions/irc/js/lib/utils.js
+@@ -467,31 +467,19 @@ function getCommonPfx (list, lcFn)
+             }
+         }
+     }
+ 
+     return pfx;
+ 
+ }
+ 
+-function getWindowByType (windowType)
+-{
+-    const MEDIATOR_CONTRACTID =
+-        "@mozilla.org/appshell/window-mediator;1";
+-    const nsIWindowMediator  = Components.interfaces.nsIWindowMediator;
+-
+-    var windowManager =
+-        Components.classes[MEDIATOR_CONTRACTID].getService(nsIWindowMediator);
+-
+-    return windowManager.getMostRecentWindow(windowType);
+-}
+-
+ function toOpenWindowByType(inType, url, features)
+ {
+-    var topWindow = getWindowByType(inType);
++    var topWindow = Services.wm.getMostRecentWindow(inType);
+ 
+     if (typeof features == "undefined")
+         features = "chrome,extrachrome,menubar,resizable," +
+                    "scrollbars,status,toolbar";
+ 
+     if (topWindow)
+         topWindow.focus();
+     else
+diff --git a/suite/extensions/irc/xul/content/commands.js b/suite/extensions/irc/xul/content/commands.js
+--- a/suite/extensions/irc/xul/content/commands.js
++++ b/suite/extensions/irc/xul/content/commands.js
+@@ -2340,17 +2340,17 @@ function cmdGotoURL(e)
+             dispatch(e.command.name + " " + getMsg(localeURLKey) + hash);
+         else
+             display(getMsg(MSG_ERR_INVALID_URL, e.url), MT_ERROR);
+ 
+         dispatch("focus-input");
+         return;
+     }
+ 
+-    var browserWin = getWindowByType("navigator:browser");
++    var browserWin = Services.wm.getMostRecentWindow("navigator:browser");
+     var location = browserWin ? browserWin.gBrowser.currentURI.spec : null;
+     var action = e.command.name;
+     let where = "current";
+ 
+     // We don't want to replace ChatZilla running in a tab.
+     if ((action == "goto-url-newwin") ||
+         ((action == "goto-url") && location &&
+          location.startsWith("chrome://chatzilla/content/")))
+@@ -3862,17 +3862,17 @@ function cmdDoCommand(e)
+ {
+     if (e.cmdName == "cmd_mozillaPrefs")
+     {
+         // Open SeaMonkey preferences.
+         goPreferences("navigator_pane");
+     }
+     else if (e.cmdName == "cmd_chatzillaPrefs")
+     {
+-        var prefWin = getWindowByType("irc:chatzilla:config");
++        var prefWin = Services.wm.getMostRecentWindow("irc:chatzilla:config");
+         if (!prefWin)
+         {
+             window.openDialog('chrome://chatzilla/content/config.xul', '',
+                               'chrome,resizable,dialog=no', window);
+         }
+         else
+         {
+             prefWin.focus();

+ 59 - 0
comm-release/patches/1924587-irc-inline-viewCert-25320.patch

@@ -0,0 +1,59 @@
+# HG changeset patch
+# User Ian Neal <iann_cvs@blueyonder.co.uk>
+# Date 1728940917 -3600
+# Parent  d3c0b9c17bd90954357c45017b6f6fa9034f4a29
+Bug 1924587 - Inline viewCert function in cZ. r=frg a=frg
+
+diff --git a/suite/extensions/irc/js/lib/utils.js b/suite/extensions/irc/js/lib/utils.js
+--- a/suite/extensions/irc/js/lib/utils.js
++++ b/suite/extensions/irc/js/lib/utils.js
+@@ -859,25 +859,16 @@ function promptPassword(msg, initial, pa
+     var rv = { value: initial };
+ 
+     if (!ps.promptPassword (parent, title, msg, rv, null, {value: null}))
+         return null;
+ 
+     return rv.value;
+ }
+ 
+-function viewCert(cert, parent)
+-{
+-    var cd = getService("@mozilla.org/nsCertificateDialogs;1",
+-                        "nsICertificateDialogs");
+-    if (!parent)
+-        parent = window;
+-    cd.viewCert(parent, cert);
+-}
+-
+ function getHostmaskParts(hostmask)
+ {
+     var rv;
+     // A bit cheeky this, we try the matches here, and then branch
+     // according to the ones we like.
+     var ary1 = hostmask.match(/([^ ]*)!([^ ]*)@(.*)/);
+     var ary2 = hostmask.match(/([^ ]*)@(.*)/);
+     var ary3 = hostmask.match(/([^ ]*)!(.*)/);
+diff --git a/suite/extensions/irc/xul/content/static.js b/suite/extensions/irc/xul/content/static.js
+--- a/suite/extensions/irc/xul/content/static.js
++++ b/suite/extensions/irc/xul/content/static.js
+@@ -2419,17 +2419,19 @@ function displayCertificateInfo()
+         return;
+ 
+     if (!o.server.isSecure)
+     {
+         alert(getMsg(MSG_INSECURE_SERVER, o.server.hostname));
+         return;
+     }
+ 
+-    viewCert(o.server.connection.getCertificate());
++    let cd = Cc["@mozilla.org/nsCertificateDialogs;1"]
++               .getService(Ci.nsICertificateDialogs);
++    cd.viewCert(window, o.server.connection.getCertificate());
+ }
+ 
+ function onLoggingIcon() {
+   client.currentObject.dispatch("log", { state: "toggle" });
+ }
+ 
+ function newInlineText (data, className, tagName)
+ {

+ 124 - 0
comm-release/patches/1924588-irc-tidy-dirsvc-25320.patch

@@ -0,0 +1,124 @@
+# HG changeset patch
+# User Ian Neal <iann_cvs@blueyonder.co.uk>
+# Date 1728941209 -3600
+# Parent  d6c94bb8433b963f510406a370281af0fae49f49
+Bug 1924588 - Remove getSpecialDirectory function and use Services.dirsvc in cZ. r=frg a=frg
+
+diff --git a/suite/extensions/irc/js/lib/utils.js b/suite/extensions/irc/js/lib/utils.js
+--- a/suite/extensions/irc/js/lib/utils.js
++++ b/suite/extensions/irc/js/lib/utils.js
+@@ -2,18 +2,16 @@
+  *
+  * This Source Code Form is subject to the terms of the Mozilla Public
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ // Namespaces we happen to need:
+ const XHTML_NS = "http://www.w3.org/1999/xhtml";
+ 
+-var utils = new Object();
+-
+ var DEBUG = true;
+ var dd, warn, TEST, ASSERT;
+ 
+ if (DEBUG) {
+     var _dd_pfx = "";
+     var _dd_singleIndent = "  ";
+     var _dd_indentLength = _dd_singleIndent.length;
+     var _dd_currentIndent = "";
+@@ -702,30 +700,16 @@ function getStackTrace ()
+         str += "\n" + name + "@" + frame.lineNumber;
+         frame = frame.caller;
+     }
+ 
+     return str;
+ 
+ }
+ 
+-function getSpecialDirectory(name)
+-{
+-    if (!("directoryService" in utils))
+-    {
+-        const DS_CTR = "@mozilla.org/file/directory_service;1";
+-        const nsIProperties = Components.interfaces.nsIProperties;
+-
+-        utils.directoryService =
+-            Components.classes[DS_CTR].getService(nsIProperties);
+-    }
+-
+-    return utils.directoryService.get(name, Components.interfaces.nsIFile);
+-}
+-
+ function getFileFromURLSpec(url)
+ {
+     var handler = Services.io.getProtocolHandler("file")
+                              .QueryInterface(Ci.nsIFileProtocolHandler);
+     return handler.getFileFromURLSpec(url);
+ }
+ 
+ function getURLSpecFromFile(file)
+diff --git a/suite/extensions/irc/xul/content/commands.js b/suite/extensions/irc/xul/content/commands.js
+--- a/suite/extensions/irc/xul/content/commands.js
++++ b/suite/extensions/irc/xul/content/commands.js
+@@ -4169,19 +4169,16 @@ function cmdDCCClose(e)
+     return true;
+ }
+ 
+ function cmdDCCSend(e)
+ {
+     if (!client.prefs["dcc.enabled"])
+         return display(MSG_DCC_NOT_ENABLED);
+ 
+-    const DIRSVC_CID = "@mozilla.org/file/directory_service;1";
+-    const nsIProperties = Components.interfaces.nsIProperties;
+-
+     if (!e.nickname && !e.user)
+         return display(MSG_DCC_ERR_NOUSER);
+ 
+     // Accept the request passed in...
+     var file;
+     if (!e.file)
+     {
+         var pickerRv = pickOpen(MSG_DCCFILE_SEND);
+@@ -4195,18 +4192,17 @@ function cmdDCCSend(e)
+         // error if it doesn't get a FULL path.
+         try
+         {
+             file = nsLocalFile(e.file);
+         }
+         catch(ex)
+         {
+             // Ok, try user's home directory.
+-            var fl = Components.classes[DIRSVC_CID].getService(nsIProperties);
+-            file = fl.get("Home", Components.interfaces.nsIFile);
++            file = Services.dirsvc.get("Home", Ci.nsIFile);
+ 
+             // Another freaking try/catch wrapper.
+             try
+             {
+                 // NOTE: This is so pathetic it can't cope with any path
+                 // separators in it, so don't even THINK about lobing a
+                 // relative path at it.
+                 file.append(e.file);
+diff --git a/suite/extensions/irc/xul/content/prefs.js b/suite/extensions/irc/xul/content/prefs.js
+--- a/suite/extensions/irc/xul/content/prefs.js
++++ b/suite/extensions/irc/xul/content/prefs.js
+@@ -14,17 +14,17 @@ function initPrefs()
+     };
+ 
+     client.prefManager = new PrefManager("extensions.irc.",
+                                          client.defaultBundle);
+     client.prefManagers = [client.prefManager];
+ 
+     client.prefs = client.prefManager.prefs;
+ 
+-    var profilePath = getSpecialDirectory("ProfD");
++    let profilePath = Services.dirsvc.get("ProfD", Ci.nsIFile);
+     profilePath.append("chatzilla");
+ 
+     client.prefManager.addPref("profilePath", profilePath.path, null, null,
+                                                                       "hidden");
+ 
+     profilePath = new nsLocalFile(client.prefs["profilePath"]);
+ 
+     if (!profilePath.exists())

+ 142 - 0
comm-release/patches/1924589-irc-tidy-nss-25320.patch

@@ -0,0 +1,142 @@
+# HG changeset patch
+# User Ian Neal <iann_cvs@blueyonder.co.uk>
+# Date 1728941590 -3600
+# Parent  69ebd9718dea3b291da86d36003a0953e2e2ec2c
+Bug 1924589 - Remove getNSSErrorClass function and tidy up NSS related code in cZ. r=frg a=frg
+
+diff --git a/suite/extensions/irc/js/lib/connection-xpcom.js b/suite/extensions/irc/js/lib/connection-xpcom.js
+--- a/suite/extensions/irc/js/lib/connection-xpcom.js
++++ b/suite/extensions/irc/js/lib/connection-xpcom.js
+@@ -20,20 +20,16 @@ const NS_ERROR_BINDING_ABORTED = NS_ERRO
+ const NS_ERROR_ABORT = 0x80004004;
+ 
+ const NS_NET_STATUS_RESOLVING_HOST = NS_ERROR_MODULE_NETWORK + 3;
+ const NS_NET_STATUS_CONNECTED_TO = NS_ERROR_MODULE_NETWORK + 4;
+ const NS_NET_STATUS_SENDING_TO = NS_ERROR_MODULE_NETWORK + 5;
+ const NS_NET_STATUS_RECEIVING_FROM = NS_ERROR_MODULE_NETWORK + 6;
+ const NS_NET_STATUS_CONNECTING_TO = NS_ERROR_MODULE_NETWORK + 7;
+ 
+-// Security error class constants:
+-const ERROR_CLASS_SSL_PROTOCOL = 1;
+-const ERROR_CLASS_BAD_CERT = 2;
+-
+ // Security Constants.
+ const STATE_IS_BROKEN = 1;
+ const STATE_IS_SECURE = 2;
+ const STATE_IS_INSECURE = 3;
+ 
+ function toSInputStream(stream)
+ {
+     let sstream = Cc["@mozilla.org/binaryinputstream;1"]
+diff --git a/suite/extensions/irc/js/lib/irc.js b/suite/extensions/irc/js/lib/irc.js
+--- a/suite/extensions/irc/js/lib/irc.js
++++ b/suite/extensions/irc/js/lib/irc.js
+@@ -1276,23 +1276,26 @@ function serv_disconnect(e)
+     /* If we're not connected and get this, it means we have almost certainly
+      * encountered a read or write error on the socket post-disconnect. There's
+      * no point propagating this any further, as we've already notified the
+      * user of the disconnect (with the right error).
+      */
+     if (!this.isConnected)
+         return;
+ 
++    let errorClass = Cc["@mozilla.org/nss_errors_service;1"]
++                       .getService(Ci.nsINSSErrorsService)
++                       .getErrorClass(e.disconnectStatus);
+     // Don't reconnect from a certificate error.
+-    var certError = (getNSSErrorClass(e.disconnectStatus) == ERROR_CLASS_BAD_CERT);
++    let badCert = (errorClass == Ci.nsINSSErrorsService.ERROR_CLASS_BAD_CERT);
+ 
+     // Don't reconnect if our connection was aborted.
+-    var wasAborted = (e.disconnectStatus == NS_ERROR_ABORT);
+-    var dontReconnect = certError || wasAborted;
+-
++    let wasAborted = (e.disconnectStatus == NS_ERROR_ABORT);
++
++    let dontReconnect = badCert || wasAborted;
+     if (((this.parent.state == NET_CONNECTING) && !dontReconnect) ||
+         /* fell off while connecting, try again */
+         (this.parent.primServ == this) && (this.parent.state == NET_ONLINE) &&
+         (!("quitting" in this) && this.parent.stayingPower && !dontReconnect))
+     { /* fell off primary server, reconnect to any host in the serverList */
+         setTimeout(delayedConnectFn, 0, this.parent);
+     }
+     else
+diff --git a/suite/extensions/irc/js/lib/utils.js b/suite/extensions/irc/js/lib/utils.js
+--- a/suite/extensions/irc/js/lib/utils.js
++++ b/suite/extensions/irc/js/lib/utils.js
+@@ -521,30 +521,16 @@ function getService(contractID, iface)
+             rv = null;
+             break;
+     }
+ 
+     return rv;
+ 
+ }
+ 
+-function getNSSErrorClass(errorCode)
+-{
+-    var nssErrSvc = getService("@mozilla.org/nss_errors_service;1", "nsINSSErrorsService");
+-
+-    try
+-    {
+-        return nssErrSvc.getErrorClass(errorCode);
+-    }
+-    catch
+-    {
+-        return 0;
+-    }
+-}
+-
+ function getContentWindow(frame)
+ {
+     try
+     {
+         if (!frame || !("contentWindow" in frame))
+             return false;
+ 
+         // The "in" operator does not detect wrappedJSObject, so don't bother.
+diff --git a/suite/extensions/irc/xul/content/handlers.js b/suite/extensions/irc/xul/content/handlers.js
+--- a/suite/extensions/irc/xul/content/handlers.js
++++ b/suite/extensions/irc/xul/content/handlers.js
+@@ -2286,35 +2286,35 @@ function my_netdisconnect (e)
+                     msg = getMsg(MSG_CONNECTION_ABORT_UNKNOWN,
+                                  [this.getURL(), e.server.getURL(),
+                                   formatException(e.exception)]);
+                 }
+                 retrying = false;
+                 break;
+ 
+             default:
+-                var errClass = getNSSErrorClass(e.disconnectStatus);
++                let nssErrSvc = Cc["@mozilla.org/nss_errors_service;1"]
++                                  .getService(Ci.nsINSSErrorsService)
++                let errClass = nssErrSvc.getErrorClass(e.disconnectStatus);
+                 // Check here if it's a cert error.
+                 // The exception adding dialog will explain the reasons.
+-                if (errClass == ERROR_CLASS_BAD_CERT)
++                if (errClass == Ci.nsINSSErrorsService.ERROR_CLASS_BAD_CERT)
+                 {
+                     var cmd = "ssl-exception";
+                     cmd += " " + e.server.hostname + " " + e.server.port;
+                     cmd += " true";
+                     msg = getMsg(MSG_INVALID_CERT, [this.getURL(), cmd]);
+                     retrying = false;
+                     break;
+                 }
+ 
+                 // If it's a protocol error, we can still display a useful message.
+                 var statusMsg = e.disconnectStatus;
+-                if (errClass == ERROR_CLASS_SSL_PROTOCOL)
++                if (errClass == Ci.nsINSSErrorsService.ERROR_CLASS_SSL_PROTOCOL)
+                 {
+-                    var nssErrSvc = getService("@mozilla.org/nss_errors_service;1",
+-                                               "nsINSSErrorsService");
+                     var errMsg = nssErrSvc.getErrorMessage(e.disconnectStatus);
+                     errMsg = errMsg.replace(/\.$/, "");
+                     statusMsg += " (" + errMsg + ")";
+                 }
+ 
+                 msg = getMsg(MSG_CLOSE_STATUS,
+                              [this.getURL(), e.server.getURL(),
+                               statusMsg]);

+ 356 - 0
comm-release/patches/1924592-irc-tidy-message-manager-25320.patch

@@ -0,0 +1,356 @@
+# HG changeset patch
+# User Ian Neal <iann_cvs@blueyonder.co.uk>
+# Date 1728942119 -3600
+# Parent  e092798953aaafdd481ed325a663bf28e2995a4d
+Bug 1924592 - Tidy message manager code in cZ. r=frg a=frg
+
+diff --git a/suite/extensions/irc/js/lib/message-manager.js b/suite/extensions/irc/js/lib/message-manager.js
+--- a/suite/extensions/irc/js/lib/message-manager.js
++++ b/suite/extensions/irc/js/lib/message-manager.js
+@@ -2,81 +2,38 @@
+  *
+  * This Source Code Form is subject to the terms of the Mozilla Public
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ //
+ function MessageManager(entities)
+ {
+-    const UC_CTRID = "@mozilla.org/intl/scriptableunicodeconverter";
+-    const nsIUnicodeConverter = 
+-        Components.interfaces.nsIScriptableUnicodeConverter;
+-
+-    this.ucConverter =
+-        Components.classes[UC_CTRID].getService(nsIUnicodeConverter);
++    this.ucConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
++                         .getService(Ci.nsIScriptableUnicodeConverter);
+     this.defaultBundle = null;
+     this.bundleList = new Array();
+     // Provide a fallback so we don't break getMsg and related constants later.
+     this.entities = entities || {};
+ }
+ 
+-// ISO-2022-JP (often used for Japanese on IRC) doesn't contain any support
+-// for hankaku kana (half-width katakana), so we support the option to convert
+-// it to zenkaku kana (full-width katakana). This does not affect any other
+-// encoding at this time.
+-MessageManager.prototype.enableHankakuToZenkaku = false;
+-
+ MessageManager.prototype.loadBrands =
+ function mm_loadbrands()
+ {
+-    var entities = this.entities;
+-    var app = getService("@mozilla.org/xre/app-info;1", "nsIXULAppInfo");
+-    if (app)
+-    {
+-        // Use App info if possible
+-        entities.brandShortName = app.name;
+-        entities.brandFullName = app.name + " " + app.version;
+-        entities.brandVendorName = app.vendor;
+-        return;
+-    }
+-
+-    var brandBundle;
+-    var path = "chrome://branding/locale/brand.properties";
+-    try
+-    {
+-        brandBundle = this.addBundle(path);
+-    }
+-    catch (exception)
+-    {
+-        // May be an older mozilla version, try another location.
+-        path = "chrome://global/locale/brand.properties";
+-        brandBundle = this.addBundle(path);
+-    }
+-
+-    entities.brandShortName = brandBundle.GetStringFromName("brandShortName");
+-    entities.brandVendorName = brandBundle.GetStringFromName("vendorShortName");
+-    // Not all versions of Suite / Fx have this defined; Cope:
+-    try
+-    {
+-        entities.brandFullName = brandBundle.GetStringFromName("brandFullName");
+-    }
+-    catch(exception)
+-    {
+-        entities.brandFullName = entities.brandShortName;
+-    }
+-
+-    // Remove all of this junk, or it will be the default bundle for getMsg...
+-    this.bundleList.pop();
++    let brandPath = "chrome://branding/locale/brand.properties";
++    let bundle = Services.strings.createBundle(brandPath);
++    this.entities.brandShortName = bundle.GetStringFromName("brandShortName");
++    this.entities.brandFullName = bundle.GetStringFromName("brandFullName");
++    this.entities.vendorShortName = bundle.GetStringFromName("vendorShortName");
+ }
+ 
+ MessageManager.prototype.addBundle = 
+ function mm_addbundle(bundlePath, targetWindow)
+ {
+-    var bundle = srGetStrBundle(bundlePath);
++    let bundle = Services.strings.createBundle(bundlePath);
+     this.bundleList.push(bundle);
+ 
+     // The bundle will load if the file doesn't exist. This will fail though.
+     // We want to be clean and remove the bundle again.
+     try
+     {
+         this.importBundle(bundle, targetWindow, this.bundleList.length - 1);
+     }
+@@ -95,17 +52,16 @@ function mm_importbundle(bundle, targetW
+     var me = this;
+     function replaceEntities(matched, entity)
+     {
+         if (entity in me.entities)
+             return me.entities[entity];
+ 
+         return matched;
+     };
+-    const nsIPropertyElement = Components.interfaces.nsIPropertyElement;
+ 
+     if (!targetWindow)
+         targetWindow = window;
+ 
+     if (typeof index == "undefined")
+         index = this.bundleList.indexOf(bundle);
+     
+     var pfx;
+@@ -113,17 +69,17 @@ function mm_importbundle(bundle, targetW
+         pfx = "";
+     else
+         pfx = index + ":";
+ 
+     var enumer = bundle.getSimpleEnumeration();
+ 
+     while (enumer.hasMoreElements())
+     {
+-        var prop = enumer.getNext().QueryInterface(nsIPropertyElement);
++        var prop = enumer.getNext().QueryInterface(Ci.nsIPropertyElement);
+         var ary = prop.key.match (/^(msg|msn)/);
+         if (ary)
+         {
+             var constValue;
+             var constName = prop.key.toUpperCase().replace (/\./g, "_");
+             if (ary[1] == "msn" || prop.value.search(/%(\d+\$)?s/i) != -1)
+                 constValue = pfx + prop.key;
+             else
+@@ -133,94 +89,16 @@ function mm_importbundle(bundle, targetW
+             targetWindow[constName] = constValue;
+         }
+     }
+ 
+     if (this.bundleList.length == 1)
+         this.defaultBundle = bundle;
+ }
+ 
+-MessageManager.prototype.convertHankakuToZenkaku =
+-function mm_converthankakutozenkaku(msg)
+-{
+-    const basicMapping = [
+-        /* 0xFF60 */ 0xFF60,0x3002,0x300C,0x300D,0x3001,0x30FB,0x30F2,0x30A1,
+-        /* 0xFF68 */ 0x30A3,0x30A5,0x30A7,0x30A9,0x30E3,0x30E5,0x30E7,0x30C3,
+-        /* 0xFF70 */ 0x30FC,0x30A2,0x30A4,0x30A6,0x30A8,0x30AA,0x30AB,0x30AD,
+-        /* 0xFF78 */ 0x30AF,0x30B1,0x30B3,0x30B5,0x30B7,0x30B9,0x30BB,0x30BD,
+-        /* 0xFF80 */ 0x30BF,0x30C1,0x30C4,0x30C6,0x30C8,0x30CA,0x30CB,0x30CC,
+-        /* 0xFF88 */ 0x30CD,0x30CE,0x30CF,0x30D2,0x30D5,0x30D8,0x30DB,0x30DE,
+-        /* 0xFF90 */ 0x30DF,0x30E0,0x30E1,0x30E2,0x30E4,0x30E6,0x30E8,0x30E9,
+-        /* 0xFF98 */ 0x30EA,0x30EB,0x30EC,0x30ED,0x30EF,0x30F3,0x309B,0x309C
+-    ];
+-
+-    const HANKAKU_BASE1 = 0xFF60;
+-    const HANKAKU_BASE2 = 0xFF80;
+-    const HANKAKU_MASK  = 0xFFE0;
+-
+-    const MOD_NIGORI      = 0xFF9E;
+-    const NIGORI_MIN1     = 0xFF76;
+-    const NIGORI_MAX1     = 0xFF84;
+-    const NIGORI_MIN2     = 0xFF8A;
+-    const NIGORI_MAX2     = 0xFF8E;
+-    const NIGORI_MODIFIER = 1;
+-
+-    const MOD_MARU      = 0xFF9F;
+-    const MARU_MIN      = 0xFF8A;
+-    const MARU_MAX      = 0xFF8E;
+-    const MARU_MODIFIER = 2;
+-
+-    var i, src, srcMod, dest;
+-    var rv = "";
+-
+-    for (i = 0; i < msg.length; i++)
+-    {
+-        // Get both this character and the next one, which could be a modifier.
+-        src = msg.charCodeAt(i);
+-        if (i < msg.length - 1)
+-            srcMod = msg.charCodeAt(i + 1);
+-
+-        // Is the source characher hankaku?
+-        if ((HANKAKU_BASE1 == (src & HANKAKU_MASK)) ||
+-            (HANKAKU_BASE2 == (src & HANKAKU_MASK)))
+-        {
+-            // Do the basic character mapping first.
+-            dest = basicMapping[src - HANKAKU_BASE1];
+-
+-            // If the source character is in the nigori or maru ranges and
+-            // the following character is the associated modifier, we apply
+-            // the modification and skip over the modifier.
+-            if (i < msg.length - 1)
+-            {
+-                if ((MOD_NIGORI == srcMod) &&
+-                    (((src >= NIGORI_MIN1) && (src <= NIGORI_MAX1)) ||
+-                     ((src >= NIGORI_MIN2) && (src <= NIGORI_MAX2))))
+-                {
+-                    dest += NIGORI_MODIFIER;
+-                    i++;
+-                }
+-                else if ((MOD_MARU == srcMod) &&
+-                         (src >= MARU_MIN) && (src <= MARU_MAX))
+-                {
+-                    dest += MARU_MODIFIER;
+-                    i++;
+-                }
+-            }
+-
+-            rv += String.fromCharCode(dest);
+-        }
+-        else
+-        {
+-            rv += msg[i];
+-        }
+-    }
+-
+-    return rv;
+-}
+-
+ MessageManager.prototype.checkCharset =
+ function mm_checkset(charset)
+ {
+     try
+     {
+         this.ucConverter.charset = charset;
+     }
+     catch (ex)
+@@ -252,35 +130,24 @@ function mm_tounicode(msg, charset)
+ }
+ 
+ MessageManager.prototype.fromUnicode =
+ function mm_fromunicode(msg, charset)
+ {
+     if (!charset)
+         return msg;
+ 
+-    if (this.enableHankakuToZenkaku && (charset.toLowerCase() == "iso-2022-jp"))
+-        msg = this.convertHankakuToZenkaku(msg);
+-
+     try
+     {
+         // This can actually fail in bizare cases. Cope.
+         if (charset != this.ucConverter.charset)
+             this.ucConverter.charset = charset;
+ 
+-        if ("Finish" in this.ucConverter)
+-        {
+-            msg = this.ucConverter.ConvertFromUnicode(msg) +
+-                this.ucConverter.Finish();
+-        }
+-        else
+-        {
+-            msg = this.ucConverter.ConvertFromUnicode(msg + " ");
+-            msg = msg.substr(0, msg.length - 1);
+-        }
++        msg = this.ucConverter.ConvertFromUnicode(msg) +
++              this.ucConverter.Finish();
+     }
+     catch (ex)
+     {
+         //dd ("caught exception " + ex + " converting " + msg + " to charset " +
+         //    charset);
+     }
+     
+     return msg;
+diff --git a/suite/extensions/irc/js/lib/utils.js b/suite/extensions/irc/js/lib/utils.js
+--- a/suite/extensions/irc/js/lib/utils.js
++++ b/suite/extensions/irc/js/lib/utils.js
+@@ -1132,38 +1132,11 @@ function strftime(format, time)
+         }
+         if (!rpl)
+             rpl = "%%" + ary[2];
+         format = format.substr(0, start) + rpl + format.substr(start + 2);
+     }
+     return format.replace(/%%/, "%");
+ }
+ 
+-// This used to be strres.js, copied here to help remove that...
+-var strBundleService = null;
+-function srGetStrBundle(path)
+-{
+-    const STRBSCID = "@mozilla.org/intl/stringbundle;1";
+-    const STRBSIF = "nsIStringBundleService";
+-    var strBundle = null;
+-    if (!strBundleService)
+-    {
+-        try
+-        {
+-            strBundleService = getService(STRBSCID, STRBSIF);
+-        }
+-        catch (ex)
+-        {
+-            dump("\n--** strBundleService failed: " + ex + "\n");
+-            return null;
+-        }
+-    }
+-
+-    strBundle = strBundleService.createBundle(path);
+-    if (!strBundle)
+-        dump("\n--** strBundle createInstance failed **--\n");
+-
+-    return strBundle;
+-}
+-
+ // No-op window.getAttention if it's not found, this is for in-a-tab mode.
+ if (typeof getAttention == "undefined")
+     getAttention = function() {};
+diff --git a/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties b/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties
+--- a/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties
++++ b/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties
+@@ -31,18 +31,18 @@ msg.confirm = Confirm
+ # The following are therefore equivalent:
+ #    cmd.foo.label = &Foo
+ # and
+ #    cmd.foo.label = Foo
+ #    cmd.foo.accesskey = F
+ #
+ #
+ # All localised strings may contain certain entities for branding purposes.
+-# The three standard brand entities (brandShortName, brandFullName, vendorName)
+-# can all be used like this:
++# The three standard brand entities (brandShortName, brandFullName,
++# vendorShortName) can all be used like this:
+ #     foo.bar = Some text used in &brandFullName;!
+ #
+ ### End of notes ###
+ 
+ cmd.about.label = About ChatZilla
+ cmd.about.help  = Display information about this version of ChatZilla.
+ 
+ cmd.alias.helpUsage = [<alias-name> [<command-list>]]
+diff --git a/suite/extensions/irc/xul/content/messages.js b/suite/extensions/irc/xul/content/messages.js
+--- a/suite/extensions/irc/xul/content/messages.js
++++ b/suite/extensions/irc/xul/content/messages.js
+@@ -4,17 +4,16 @@
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+ function initMessages()
+ {
+     var path = "chrome://chatzilla/locale/chatzilla.properties";
+     
+     client.messageManager = new MessageManager(client.entities);
+-    client.messageManager.enableHankakuToZenkaku = true;
+     client.messageManager.loadBrands();
+     client.defaultBundle = client.messageManager.addBundle(path);
+ 
+     client.viewName = client.unicodeName = MSG_CLIENT_NAME;
+     client.responseCodeMap =
+         {
+             "HELLO": MSG_RSP_HELLO,
+             "HELP" : MSG_RSP_HELP,

+ 320 - 0
comm-release/patches/1924595-irc-getService-25320.patch

@@ -0,0 +1,320 @@
+# HG changeset patch
+# User Ian Neal <iann_cvs@blueyonder.co.uk>
+# Date 1728942983 -3600
+# Parent  f37b7e4f8eb101af6667690cb8fc193c00858416
+Bug 1924595 - Remove getService helper and tidy up code around its callers in cZ. r=frg a=frg
+
+diff --git a/suite/extensions/irc/js/lib/dcc.js b/suite/extensions/irc/js/lib/dcc.js
+--- a/suite/extensions/irc/js/lib/dcc.js
++++ b/suite/extensions/irc/js/lib/dcc.js
+@@ -27,32 +27,25 @@ function CIRCDCC(parent)
+     this.requestTimeout = 3 * 60 * 1000; // 3 minutes.
+ 
+     // Can't do anything 'til this is set!
+     this.localIPlist = new Array();
+     this.localIP = null;
+     this._lastPort = null;
+ 
+     try {
+-        var dnsComp = Components.classes["@mozilla.org/network/dns-service;1"];
+-        this._dnsSvc = dnsComp.getService(Components.interfaces.nsIDNSService);
++        this._dnsSvc = Cc["@mozilla.org/network/dns-service;1"]
++                         .getService(Ci.nsIDNSService);
+ 
+         // Get local hostname.
+-        if ("myHostName" in this._dnsSvc) {
+-            // Using newer (1.7a+) version with DNS re-write.
+-            this.addHost(this._dnsSvc.myHostName);
+-        }
+-        if ("myIPAddress" in this._dnsSvc) {
+-            // Older Mozilla, have to use this method.
+-            this.addIP(this._dnsSvc.myIPAddress);
+-        }
++        this.addHost(this._dnsSvc.myHostName);
+         this.addHost("localhost");
+     } catch(ex) {
+         // what to do?
+-        dd("Error getting local IPs: " + ex);
++        dd("Error getting local hostnames: " + ex);
+     }
+ 
+     this._lastID = Math.round(Math.random() * DCC_ID_MAX);
+ 
+     return this;
+ }
+ 
+ CIRCDCC.prototype.TYPE = "IRCDCC";
+@@ -91,17 +84,17 @@ function dcc_addhost(host, auth)
+             {
+                 while (record.hasMore())
+                     me.addIP(record.getNextAddrAsString(), auth);
+             }
+         }
+     };
+ 
+     try {
+-        var th = getService("@mozilla.org/thread-manager;1").currentThread;
++        var th = Services.tm.currentThread;
+         var dnsRecord = this._dnsSvc.asyncResolve(host, false, listener, th);
+     } catch (ex) {
+         dd("Error resolving host to IP: " + ex);
+     }
+ }
+ 
+ CIRCDCC.prototype.addIP =
+ function dcc_addip(ip, auth)
+diff --git a/suite/extensions/irc/js/lib/ident.js b/suite/extensions/irc/js/lib/ident.js
+--- a/suite/extensions/irc/js/lib/ident.js
++++ b/suite/extensions/irc/js/lib/ident.js
+@@ -7,17 +7,18 @@
+ // RFC1413-ish identification server for ChatZilla
+ // One Ident Server is used for all networks. When multiple networks are in the
+ // process of connecting, it won't stop listening until they're all done.
+ 
+ function IdentServer(parent)
+ {
+     this.responses = new Array();
+     this.listening = false;
+-    this.dns = getService("@mozilla.org/network/dns-service;1","nsIDNSService");
++    this.dns = Cc["@mozilla.org/network/dns-service;1"]
++                 .getService(Ci.nsIDNSService);
+ 
+     this.parent = parent;
+     this.eventPump = parent.eventPump;
+ }
+ 
+ IdentServer.prototype.start =
+ function ident_start()
+ {
+diff --git a/suite/extensions/irc/js/lib/utils.js b/suite/extensions/irc/js/lib/utils.js
+--- a/suite/extensions/irc/js/lib/utils.js
++++ b/suite/extensions/irc/js/lib/utils.js
+@@ -490,47 +490,16 @@ function renameProperty (obj, oldname, n
+     if (oldname == newname)
+         return;
+ 
+     obj[newname] = obj[oldname];
+     delete obj[oldname];
+ 
+ }
+ 
+-function getService(contractID, iface)
+-{
+-    var rv;
+-    var cls = Components.classes[contractID];
+-
+-    if (!cls)
+-        return null;
+-
+-    switch (typeof iface)
+-    {
+-        case "undefined":
+-            rv = cls.getService();
+-            break;
+-
+-        case "string":
+-            rv = cls.getService(Components.interfaces[iface]);
+-            break;
+-
+-        case "object":
+-            rv = cls.getService(iface);
+-            break;
+-
+-        default:
+-            rv = null;
+-            break;
+-    }
+-
+-    return rv;
+-
+-}
+-
+ function getContentWindow(frame)
+ {
+     try
+     {
+         if (!frame || !("contentWindow" in frame))
+             return false;
+ 
+         // The "in" operator does not detect wrappedJSObject, so don't bother.
+diff --git a/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties b/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties
+--- a/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties
++++ b/suite/extensions/irc/locales/en-US/chrome/chatzilla.properties
+@@ -668,17 +668,16 @@ msg.err.no.ctcp.help  = %S does not have
+ msg.err.unable.to.print = The current view does not support printing.
+ msg.err.unsupported.command = The server does not support the ``%S'' command.
+ msg.err.invalid.mode  = The mode string you entered (``%S'') is invalid. A valid mode string consists of one or more sequences of a + or - followed by one or more alphabetical characters.
+ msg.err.away.save     = Saving the list of away messages failed (%S).
+ msg.err.inputhistory.not.writable = Unable to save input history to ``%S''.
+ msg.err.urls.not.writable = Unable to save URL log to ``%S''.
+ msg.err.invalid.url   = ``%S'' is not a valid url nor an alias for a url, and therefore could not be loaded.
+ msg.err.no.channel    = When running the ``%S'' command, you should either provide a channel name, or run the command in the context of a channel.
+-msg.err.no.idleservice = ChatZilla can't determine when you're away in your version of &brandShortName;. The auto-away feature will now be disabled.
+ 
+ msg.warn.pac.loading = The automatic proxy configuration file has not loaded yet; ChatZilla will retry shortly.
+ 
+ # Ask for nick pass if not explicitly given in the command:
+ msg.need.identify.password = Please enter the Nickname Services password for this nickname.
+ 
+ # Ask for oper pass if not explicitly given in the command:
+ msg.need.oper.password = Please enter a password for obtaining IRC Operator privileges.
+diff --git a/suite/extensions/irc/xul/content/commands.js b/suite/extensions/irc/xul/content/commands.js
+--- a/suite/extensions/irc/xul/content/commands.js
++++ b/suite/extensions/irc/xul/content/commands.js
+@@ -4692,18 +4692,18 @@ function cmdFind(e)
+     if (!e.rest)
+     {
+         findInPage(getFindData(e));
+         return;
+     }
+ 
+     // Used from the inputbox, set the search string and find the first
+     // occurrence using find-again.
+-    const FINDSVC_ID = "@mozilla.org/find/find_service;1";
+-    var findService = getService(FINDSVC_ID, "nsIFindService");
++    let findService = Cc["@mozilla.org/find/find_service;1"]
++                        .getService(Ci.nsIFindService);
+     // Make sure it searches the entire document, but don't lose the old setting
+     var oldWrap = findService.wrapFind;
+     findService.wrapFind = true;
+     findService.searchString = e.rest;
+     findAgainInPage(getFindData(e));
+     // Restore wrap setting:
+     findService.wrapFind = oldWrap;
+ }
+diff --git a/suite/extensions/irc/xul/content/prefs.js b/suite/extensions/irc/xul/content/prefs.js
+--- a/suite/extensions/irc/xul/content/prefs.js
++++ b/suite/extensions/irc/xul/content/prefs.js
+@@ -48,34 +48,32 @@ function initPrefs()
+     if (!downloadsPath.exists())
+         mkdir(downloadsPath);
+ 
+     var logDefault = client.prefManager.logPath.clone();
+     logDefault.append(escapeFileName("client.log"));
+ 
+     // Set up default nickname, if possible.
+     var defaultNick = DEFAULT_NICK;
+-    var en = getService("@mozilla.org/process/environment;1", "nsIEnvironment");
+-    if (en)
+-    {
+-        /* Get the enviroment variables used by various OSes:
+-         *   USER     - Linux, macOS and other *nix-types.
+-         *   USERNAME - Windows.
+-         *   LOGNAME  - *nix again.
+-         */
+-        const vars = ["USER", "USERNAME", "LOGNAME"];
+-
+-        for (var i = 0; i < vars.length; i++)
++    let env = Cc["@mozilla.org/process/environment;1"]
++                .getService(Ci.nsIEnvironment);
++    /* Get the enviroment variables used by various OSes:
++     *   USER     - Linux, macOS and other *nix-types.
++     *   USERNAME - Windows.
++     *   LOGNAME  - *nix again.
++     */
++    const vars = ["USER", "USERNAME", "LOGNAME"];
++
++    for (let varName of vars)
++    {
++        let nick = env.get(varName);
++        if (nick)
+         {
+-            var nick = en.get(vars[i]);
+-            if (nick)
+-            {
+-                defaultNick = nick.replace(/ /g, "_");
+-                break;
+-            }
++            defaultNick = nick.replace(/ /g, "_");
++            break;
+         }
+     }
+ 
+     // Set a property so network ident prefs get the same group later:
+     client.prefManager.identGroup = ".connect";
+     // Linux and OS X won't let non-root listen on port 113.
+     if ((client.platform == "Linux") || (client.platform == "Mac"))
+         client.prefManager.identGroup = "hidden";
+diff --git a/suite/extensions/irc/xul/content/static.js b/suite/extensions/irc/xul/content/static.js
+--- a/suite/extensions/irc/xul/content/static.js
++++ b/suite/extensions/irc/xul/content/static.js
+@@ -491,18 +491,18 @@ function getFindData(e)
+      * restoring the original value afterwards doesn't help, because init() here
+      * overrides that value. Unless we make .init do something else, of course:
+      */
+     findData._init = findData.init;
+     findData.init =
+         function init()
+         {
+             this._init();
+-            const FINDSVC_ID = "@mozilla.org/find/find_service;1";
+-            var findService = getService(FINDSVC_ID, "nsIFindService");
++            let findService = Cc["@mozilla.org/find/find_service;1"]
++                                .getService(Ci.nsIFindService);
+             this.webBrowserFind.wrapFind = findService.wrapFind;
+         };
+ 
+     return findData;
+ }
+ 
+ function importFromFrame(method)
+ {
+@@ -2118,52 +2118,30 @@ client.idleObserver = {
+ };
+ 
+ function initIdleAutoAway(timeout)
+ {
+     // Don't try to do anything if we are disabled
+     if (!timeout)
+         return;
+ 
+-    var is = getService("@mozilla.org/widget/idleservice;1", "nsIIdleService");
+-    if (!is)
+-    {
+-        display(MSG_ERR_NO_IDLESERVICE, MT_WARN);
+-        client.prefs["autoIdleTime"] = 0;
+-        return;
+-    }
+-
+-    try
+-    {
+-        is.addIdleObserver(client.idleObserver, timeout * 60);
+-    }
+-    catch (ex)
+-    {
+-        display(formatException(ex), MT_ERROR);
+-    }
++    let idleService = Cc["@mozilla.org/widget/idleservice;1"]
++                        .getService(Ci.nsIIdleService);
++    idleService.addIdleObserver(client.idleObserver, timeout * 60);
+ }
+ 
+ function uninitIdleAutoAway(timeout)
+ {
+     // Don't try to do anything if we were disabled before
+     if (!timeout)
+         return;
+ 
+-    var is = getService("@mozilla.org/widget/idleservice;1", "nsIIdleService");
+-    if (!is)
+-        return;
+-
+-    try
+-    {
+-        is.removeIdleObserver(client.idleObserver, timeout * 60);
+-    }
+-    catch (ex)
+-    {
+-        display(formatException(ex), MT_ERROR);
+-    }
++    let idleService = Cc["@mozilla.org/widget/idleservice;1"]
++                        .getService(Ci.nsIIdleService);
++    idleService.removeIdleObserver(client.idleObserver, timeout * 60);
+ }
+ 
+ function updateAppMotif(motifURL)
+ {
+     var node = document.firstChild;
+     while (node && ((node.nodeType != node.PROCESSING_INSTRUCTION_NODE) ||
+                     !(/name="dyn-motif"/).test(node.data)))
+     {

+ 6 - 0
comm-release/patches/series

@@ -2212,3 +2212,9 @@ TOP-1378089-4-WIP-bookmarks-25320.patch
 TOP-1872623-cancelbookmark-25319.patch
 TOP-1872623-cancelbookmark-25319.patch
 9999999-specificsearch-25320.patch
 9999999-specificsearch-25320.patch
 9999999-focus-25320.patch
 9999999-focus-25320.patch
+1924586-irc-remove-getWindowByType-25320.patch
+1924587-irc-inline-viewCert-25320.patch
+1924588-irc-tidy-dirsvc-25320.patch
+1924589-irc-tidy-nss-25320.patch
+1924592-irc-tidy-message-manager-25320.patch
+1924595-irc-getService-25320.patch