Bug 1525695 - fix a bunch of missing imports in IRC and IM related code. r=florian
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Thu, 07 Feb 2019 20:13:40 +0100
changeset 25791 b8273f79234eae97ff8b1527e5ab8a5380a1f1ad
parent 25790 e06a970817c63be9ca89d8eea31cdf7eb258a188
child 25792 029ec755385fec42b74065b5b67781f5eb18f74a
push id15477
push usermozilla@jorgk.com
push dateThu, 07 Feb 2019 21:52:00 +0000
treeherdercomm-central@029ec755385f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1525695
Bug 1525695 - fix a bunch of missing imports in IRC and IM related code. r=florian
chat/components/src/imAccounts.js
chat/modules/jsProtoHelper.jsm
chat/protocols/irc/irc.js
mail/components/im/content/imconversation.xml
--- a/chat/components/src/imAccounts.js
+++ b/chat/components/src/imAccounts.js
@@ -1,16 +1,19 @@
 /* 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/. */
 var {
   ClassInfo,
   EmptyEnumerator,
   nsSimpleEnumerator,
   XPCOMUtils,
+  setTimeout,
+  clearTimeout,
+  executeSoon,
 } = ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 var {Services} = ChromeUtils.import("resource:///modules/imServices.jsm");
 var {GenericAccountPrototype, GenericAccountBuddyPrototype} = ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 var kPrefAutologinPending = "messenger.accounts.autoLoginPending";
 var kPrefMessengerAccounts = "messenger.accounts";
 var kPrefAccountPrefix = "messenger.account.";
 var kAccountKeyPrefix = "account";
--- a/chat/modules/jsProtoHelper.jsm
+++ b/chat/modules/jsProtoHelper.jsm
@@ -15,16 +15,17 @@ this.EXPORTED_SYMBOLS = [
   "TooltipInfo"
 ];
 
 const {
   EmptyEnumerator,
   initLogModule,
   XPCOMUtils,
   nsSimpleEnumerator,
+  l10nHelper,
 } = ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource:///modules/imServices.jsm");
 const {ClassInfo} = ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/conversations.properties")
 );
 
--- a/chat/protocols/irc/irc.js
+++ b/chat/protocols/irc/irc.js
@@ -2,17 +2,19 @@
  * 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/. */
 
 var {
   ClassInfo,
   clearTimeout,
   EmptyEnumerator,
   setTimeout,
+  executeSoon,
   XPCOMUtils,
+  nsSimpleEnumerator,
 } = ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 var {Services} = ChromeUtils.import("resource:///modules/imServices.jsm");
 var {
   _,
   _conv,
   ctcpFormatToText,
   ctcpFormatToHTML,
   conversationErrorMessage,
--- a/mail/components/im/content/imconversation.xml
+++ b/mail/components/im/content/imconversation.xml
@@ -78,16 +78,17 @@
      <method name="destroy">
        <body>
          <![CDATA[
            if (this._conv)
              this._forgetConv();
 
            if ("MessageFormat" in window) {
              let textbox = this.editor;
+             const {MessageFormat, TextboxSpellChecker} = ChromeUtils.import("resource:///modules/imTextboxUtils.jsm");
              MessageFormat.unregisterTextbox(textbox);
              TextboxSpellChecker.unregisterTextbox(textbox);
            }
          ]]>
        </body>
      </method>
 
      <method name="_forgetConv">
@@ -394,17 +395,17 @@
       </body>
      </method>
 
      <method name="initTextboxFormat">
       <body>
       <![CDATA[
         let textbox = this.editor;
 
-        const {MessageFormat} = ChromeUtils.import("resource:///modules/imTextboxUtils.jsm");
+        const {MessageFormat, TextboxSpellChecker} = ChromeUtils.import("resource:///modules/imTextboxUtils.jsm");
         MessageFormat.registerTextbox(textbox);
 
         // Init the textbox size
         this.calculateTextboxDefaultHeight();
         textbox.parentNode.height = textbox.defaultHeight +
                                     this._TEXTBOX_VERTICAL_OVERHEAD;
         textbox.inputField.style.overflowY = "hidden";
 
@@ -816,16 +817,17 @@
         inputBox.value = "";
         this.getElt("charCounter").setAttribute("value", "");
         inputBox.removeAttribute("invalidInput");
 
         this._statusText = "";
         this.displayStatusText();
 
         let overflow = "";
+        const {TextboxSize} = ChromeUtils.import("resource:///modules/imTextboxUtils.jsm");
         if (TextboxSize.autoResize) {
           let currHeight = parseInt(inputBox.parentNode.height);
           if (inputBox.defaultHeight + this._TEXTBOX_VERTICAL_OVERHEAD > currHeight)
             inputBox.defaultHeight = currHeight - this._TEXTBOX_VERTICAL_OVERHEAD;
           this.getElt("conv-bottom").height =
             inputBox.defaultHeight + this._TEXTBOX_VERTICAL_OVERHEAD;
           overflow = "hidden";
         }
@@ -839,16 +841,17 @@
       <parameter name="event"/>
       <body>
       <![CDATA[
         let textbox = this.editor;
         let input = textbox.inputField;
 
         // This feature has been disabled, or the user is currently dragging
         // the splitter and the textbox has received an overflow event
+        const {TextboxSize} = ChromeUtils.import("resource:///modules/imTextboxUtils.jsm");
         if (!TextboxSize.autoResize ||
             this.getElt("splitter-bottom").getAttribute("state") == "dragging") {
           input.style.overflowY = "";
           return;
         }
 
         // Check whether we can increase the height without hiding the status bar
         // (ensure the min-height property on the top part of this dialog)
@@ -895,27 +898,28 @@
 
           if (convTopHeight == convTopMinHeight) {
             textbox.parentNode.height = parseInt(textbox.parentNode.minHeight);
             convTopHeight = parseInt(convTopStyle.getPropertyValue("height"));
             textbox.parentNode.height = parseInt(textbox.parentNode.minHeight) +
                                         (convTopHeight - convTopMinHeight);
           }
         }
-
+        const {TextboxSize} = ChromeUtils.import("resource:///modules/imTextboxUtils.jsm");
         if (TextboxSize.autoResize)
           this.inputExpand();
       ]]>
       </body>
      </method>
 
      <method name="_onTextboxUnderflow">
       <parameter name="event"/>
       <body>
       <![CDATA[
+        const {TextboxSize} = ChromeUtils.import("resource:///modules/imTextboxUtils.jsm");
         if (TextboxSize.autoResize)
           this.inputField.style.overflowY = "hidden";
       ]]>
       </body>
      </method>
 
      <method name="browserKeyPress">
      <parameter name="event"/>