Bug 1532967 - fix chat "box.appendNotification is not a function". r=kaie
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Thu, 14 Mar 2019 11:47:28 +0200
changeset 26092 0926693124ee
parent 26091 56b74566e302
child 26093 5dbc2aa48128
push id15664
push usermozilla@jorgk.com
push dateThu, 14 Mar 2019 17:23:27 +0000
treeherdercomm-central@0926693124ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaie
bugs1532967
Bug 1532967 - fix chat "box.appendNotification is not a function". r=kaie The same id="chatTabPanel" was used for two different elements.
mail/components/im/content/chat-messenger.inc.xul
mail/components/im/content/chat-messenger.js
--- a/mail/components/im/content/chat-messenger.inc.xul
+++ b/mail/components/im/content/chat-messenger.inc.xul
@@ -87,17 +87,17 @@
               <toolbarbutton id="button-chat-appmenu"
                              class="toolbarbutton-1 button-appmenu"
                              label="&appmenuButton.label;"
                              tooltiptext="&appmenuButton1.tooltip;"/>
             </toolbarpalette>
             <toolbarset id="customChatToolbars" context="chat-toolbar-context-menu"/>
           </toolbox>
 
-          <notificationbox id="chatTabPanel" flex="1" notificationside="top">
+          <notificationbox id="chatNotificationBox" flex="1" notificationside="top">
             <hbox id="chatPanel" flex="1">
               <vbox id="listPaneBox" minwidth="125" width="200" persist="width">
                 <richlistbox id="contactlistbox"
                              context="buddyListContextMenu"
                              tooltip="imTooltip" flex="1">
                   <imgroup id="conversationsGroup" name="&conversationsHeader.label;"/>
                   <imconv id="searchResultConv" displayname="&searchResultConversation.label;" hidden="true"/>
                   <imgroup id="onlinecontactsGroup" name="&onlineContactsHeader.label;"/>
--- a/mail/components/im/content/chat-messenger.js
+++ b/mail/components/im/content/chat-messenger.js
@@ -1023,32 +1023,31 @@ var chatHandler = {
         label: bundle.getString("buddy.authRequest.allow.label"),
         callback() { aSubject.grant(); },
       };
       let denyButton = {
         accessKey: bundle.getString("buddy.authRequest.deny.accesskey"),
         label: bundle.getString("buddy.authRequest.deny.label"),
         callback() { aSubject.deny(); },
       };
-      let box = document.getElementById("chatTabPanel");
+      let box = document.getElementById("chatNotificationBox");
       box.appendNotification(label, value, null, box.PRIORITY_INFO_HIGH,
                             [acceptButton, denyButton]);
       if (!gChatTab) {
         let tabmail = document.getElementById("tabmail");
         tabmail.openTab("chat", {background: true});
       }
       return;
     }
     if (aTopic == "buddy-authorization-request-canceled") {
       aSubject.QueryInterface(Ci.prplIBuddyRequest);
       let value =
         "buddy-auth-request-" + aSubject.account.id + aSubject.userName;
-      let notification =
-        document.getElementById("chatTabPanel")
-                .getNotificationWithValue(value);
+      let box = document.getElementById("chatNotificationBox");
+      let notification = box.getNotificationWithValue(value);
       if (notification)
         notification.close();
     }
   },
   initAfterChatCore() {
     let onGroup = document.getElementById("onlinecontactsGroup");
     let offGroup = document.getElementById("offlinecontactsGroup");